本文整理汇总了Java中com.helger.commons.collection.ArrayHelper.getCopy方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayHelper.getCopy方法的具体用法?Java ArrayHelper.getCopy怎么用?Java ArrayHelper.getCopy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.helger.commons.collection.ArrayHelper
的用法示例。
在下文中一共展示了ArrayHelper.getCopy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LineDashPatternSpec
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
/**
* @param aPattern
* The pattern array. May not be <code>null</code>. Must have 0-2
* items. 0 items means solid line, 1 item means identical on and off
* length and 2 items means potentially different on and off length.
* All contains values must be > 0.
* @param fPhase
* The phase of the pattern. Where to start the painting, first
* counting on than off.
*/
public LineDashPatternSpec (@Nonnull final float [] aPattern, final float fPhase)
{
ValueEnforcer.notNull (aPattern, "Pattern");
ValueEnforcer.isTrue (aPattern.length <= 2,
() -> "Too many patterns (" + aPattern.length + ") provided. At max 2 items are allowed.");
for (final float fPatternValue : aPattern)
ValueEnforcer.isGT0 (fPatternValue, "PatternValue");
m_aPattern = ArrayHelper.getCopy (aPattern);
m_fPhase = fPhase;
}
示例2: getPattern
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
/**
* @return A copy with all patterns. 0-2 elements.
*/
@Nonnull
@ReturnsMutableCopy
public float [] getPattern ()
{
return ArrayHelper.getCopy (m_aPattern);
}
示例3: getAsByteArray
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
/**
* Get everything as a big byte array, without altering the ByteBuffer. This
* works only if the contained ByteBuffer has a backing array.
*
* @return The content of the buffer as a byte array. Never <code>null</code>.
*/
@Nonnull
@ReturnsMutableCopy
public byte [] getAsByteArray ()
{
final byte [] aArray = m_aBuffer.array ();
final int nOfs = m_aBuffer.arrayOffset ();
final int nLength = m_aBuffer.position ();
return ArrayHelper.getCopy (aArray, nOfs, nLength);
}
示例4: getAllArgs
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
/**
* Get all arguments from the constructor.
*
* @return a copy of all arguments. Neither <code>null</code> nor empty-
*/
@Nonnull
@Nonempty
@ReturnsMutableCopy
public Object [] getAllArgs ()
{
return ArrayHelper.getCopy (m_aArgs);
}
示例5: getAllTSpecialChars
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
/**
* @return A copy of the array with all TSpecial chars. Never
* <code>null</code>.
*/
@Nonnull
@ReturnsMutableCopy
public static char [] getAllTSpecialChars ()
{
return ArrayHelper.getCopy (TSPECIAL);
}
示例6: getAllDigestBytes
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
/**
* @return A copy of the message digest bytes. The length depends on the used
* algorithm. Never <code>null</code>.
*/
@Nonnull
@Nonempty
@ReturnsMutableCopy
public byte [] getAllDigestBytes ()
{
return ArrayHelper.getCopy (m_aDigestBytes);
}
示例7: ThreadDeadlockInfo
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
public ThreadDeadlockInfo (@Nonnull final ThreadInfo aThreadInfo,
@Nonnull final Thread aThread,
@Nullable final StackTraceElement [] aStackTrace)
{
m_aThreadInfo = ValueEnforcer.notNull (aThreadInfo, "ThreadInfo");
m_aThread = ValueEnforcer.notNull (aThread, "Thread");
m_aStackTrace = ArrayHelper.getCopy (aStackTrace);
}
示例8: getEncoded
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
@Nonnull
public byte [] getEncoded ()
{
return ArrayHelper.getCopy (m_aBytes);
}
示例9: getAllBytes
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
@Nonnull
@ReturnsMutableCopy
public final byte [] getAllBytes ()
{
return ArrayHelper.getCopy (m_aBytes);
}
示例10: MessageDigestValue
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
public MessageDigestValue (@Nonnull final EMessageDigestAlgorithm eAlgorithm,
@Nonnull @Nonempty final byte [] aDigestBytes)
{
m_eAlgorithm = ValueEnforcer.notNull (eAlgorithm, "Algorithm");
m_aDigestBytes = ArrayHelper.getCopy (ValueEnforcer.notEmpty (aDigestBytes, "DigestBytes"));
}
示例11: getData
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
@Nonnull
@ReturnsMutableCopy
public final byte [] getData ()
{
return ArrayHelper.getCopy (m_aData);
}
示例12: CSSDataURL
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
/**
* Full constructor
*
* @param aMimeType
* The MIME type to be used. May not be <code>null</code>. If you don't
* know provide the default MIME type from
* {@link CSSDataURLHelper#DEFAULT_MIME_TYPE}.
* @param bBase64Encoded
* <code>true</code> if the data URL String representation should be
* Base64 encoded, <code>false</code> if not. It is recommended to set
* this to <code>true</code> if you have binary data like images.
* @param aContent
* The content of the data URL as a byte array. May not be
* <code>null</code> but may be empty. This content may not be Base64
* encoded!
* @param aCharset
* The charset to be used to encode the String. May not be
* <code>null</code>. The default is
* {@link CSSDataURLHelper#DEFAULT_CHARSET}.
* @param sContent
* The String representation of the content. It must match the byte
* array in the specified charset. If this parameter is
* <code>null</code> than the String content representation is lazily
* created in {@link #getContentAsString()}.
*/
public CSSDataURL (@Nonnull final IMimeType aMimeType,
final boolean bBase64Encoded,
@Nonnull final byte [] aContent,
@Nonnull final Charset aCharset,
@Nullable final String sContent)
{
ValueEnforcer.notNull (aMimeType, "MimeType");
ValueEnforcer.notNull (aContent, "Content");
ValueEnforcer.notNull (aCharset, "Charset");
// Check if a charset is contained in the MIME type and if it matches the
// provided charset
final Charset aMimeTypeCharset = MimeTypeHelper.getCharsetFromMimeType (aMimeType);
if (aMimeTypeCharset == null)
{
// No charset found in MIME type
if (!aCharset.equals (CSSDataURLHelper.DEFAULT_CHARSET))
{
// append charset only if it is not the default charset
m_aMimeType = ((MimeType) aMimeType.getClone ()).addParameter (CMimeType.PARAMETER_NAME_CHARSET,
aCharset.name ());
}
else
{
// Default charset provided
m_aMimeType = aMimeType;
}
}
else
{
// MIME type has a charset - check if it matches the passed one
if (!aMimeTypeCharset.equals (aCharset))
throw new IllegalArgumentException ("The provided charset '" +
aCharset.name () +
"' differs from the charset in the MIME type: '" +
aMimeTypeCharset.name () +
"'");
m_aMimeType = aMimeType;
}
m_bBase64Encoded = bBase64Encoded;
m_aContent = ArrayHelper.getCopy (aContent);
m_aCharset = aCharset;
m_sContent = sContent;
}
示例13: ReadableResourceByteArray
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
public ReadableResourceByteArray (@Nullable final String sResourceID, @Nonnull final byte [] aBytes)
{
super (StringHelper.hasText (sResourceID) ? sResourceID : "byte[]");
// Create a copy to avoid outside modifications
m_aBytes = ArrayHelper.getCopy (ValueEnforcer.notNull (aBytes, "Bytes"));
}
示例14: ArrayIteratorFloat
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
/**
* constructor with offset and length
*
* @param aArray
* Source array
* @param nOfs
* Offset. Must be ≥ 0.
* @param nLength
* Length. Must be ≥ 0.
*/
public ArrayIteratorFloat (@Nonnull final float [] aArray,
@Nonnegative final int nOfs,
@Nonnegative final int nLength)
{
ValueEnforcer.isArrayOfsLen (aArray, nOfs, nLength);
m_aArray = ArrayHelper.getCopy (aArray, nOfs, nLength);
}
示例15: getContentBytes
import com.helger.commons.collection.ArrayHelper; //导入方法依赖的package包/类
/**
* Get a copy of all content bytes. No Base64 encoding is performed in this
* method.
*
* @return A copy of the binary data of the data URL. Neither
* <code>null</code> but maybe empty.
*/
@Nonnull
@ReturnsMutableCopy
public byte [] getContentBytes ()
{
return ArrayHelper.getCopy (m_aContent);
}