| Modifier and Type | Field and Description |
|---|---|
| public static final IntUnaryOperator | |
| public static final char | |
| public static final Level | |
| public static final char | |
| public static final String | |
| public static final long | MAX_UINT32_VALUE
Maximum value of a |
| public static final int | MAX_UINT8_VALUE
Maximum value of a |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static <A extends Appendable> A | |
| public static <A extends Appendable> A | |
| public static < The generic buffer type B extends Buffer> B | Returns: The same as the input instanceA buffer)Buffer instance - ignored if nullInvokes |
| public static byte[] | Returns: The decoded bytesThe separator between the HEX values - may be separator, CharSequence EMPTY_HEX_SEPARATORThe csq)CharSequence containing the HEX encoded bytes
|
| public static byte[] | Returns: The decoded bytesThe separator between the HEX values - may be separator, CharSequence EMPTY_HEX_SEPARATORThe csq, int CharSequence containing the HEX encoded bytesStart offset of the HEX sequence (inclusive) start, int End offset of the HEX sequence (exclusive) end)
|
| public static < The S extends OutputStream> intOutputStream generic type | Returns: The number of bytes written to the streamThe target stream, char OutputStreamThe separator between the HEX values - may be separator, CharSequence EMPTY_HEX_SEPARATORThe csq)CharSequence containing the HEX encoded bytes
|
| public static < The S extends OutputStream> intOutputStream generic type | Returns: The number of bytes written to the streamThe target stream, char OutputStreamThe separator between the HEX values - may be separator, CharSequence EMPTY_HEX_SEPARATORThe csq, int CharSequence containing the HEX encoded bytesStart offset of the HEX sequence (inclusive) start, int End offset of the HEX sequence (exclusive) end)
|
| public static void | dumpHex(SimplifiedLog logger, Level level, String prefix, PropertyResolver resolver, char sep, byte... data)
|
| public static void | dumpHex(SimplifiedLog logger, Level level, String prefix, PropertyResolver resolver, char sep, byte[] data, int offset, int len)
|
| public static void | |
| public static void | dumpHex(SimplifiedLog logger, Level level, String prefix, char sep, int chunkSize, byte[] data, int offset, int len)
|
| public static boolean | Returns: true if all bytes in the compared arrays are equal1st array a1, byte[] 2nd array a2)Compares the contents of 2 arrays of bytes - Note: do not use it to execute security related comparisons (e.g. MACs) since the method leaks timing information. |
| public static boolean | Returns: true if all bytes in the compared arrays are equal when compared from the specified
offsets and up to specified length1st array a1, int Offset to start comparing in 1st array a1Offset, byte[] 2nd array a2, int Offset to start comparing in 2nd array a2Offset, int Number of bytes to compare length)Compares the contents of 2 arrays of bytes - Note: do not use it to execute security related comparisons (e.g. MACs) since the method leaks timing information. |
| public static byte | |
| public static BigInteger | |
| public static int | Returns: The integer value readA buffer holding a 32-bit signed integer in big endian format. buf, int The offset of the data in the buffer off, int The available data length len)Note if more than 4 bytes are available, then only the first 4 bytes in the buffer will be used (starting at the specified offset)
|
| public static long | |
| public static int | |
| public static long | Returns: The result as along whose 32 high-order bits are zeroA buffer holding a 32-bit unsigned integer in big endian format buf)Note if more than 4 bytes are available, then only the first 4 bytes in the buffer will be used
|
| public static long | Returns: The result as along whose 32 high-order bits are zeroA buffer holding a 32-bit unsigned integer in big endian format. buf, int The offset of the data in the buffer off, int The available data length len)Note if more than 4 bytes are available, then only the first 4 bytes in the buffer will be used (starting at the specified offset)
|
| public static int | Returns: the index of the value within the array,-1 if not found or null array input
or non-positive number of elementsthe array to search through for the object, may be array, byte nullthe value to find valueToFind, int the index to start searching at startIndex, int the number of elements to search from the start index len)Finds the index of the given value in the array starting at the given index and checking up to specified number of elements. |
| public static boolean | |
| public static boolean | |
| public static int | |
| public static int | Returns: The number of bytes used in the bufferThe 32-bit value value, byte[] The buffer buf)Writes a 32-bit value in network order (i.e., MSB 1st) |
| public static int | Returns: The number of bytes used in the bufferThe 32-bit value value, byte[] The buffer buf, int The offset to write the value off, int The available space len)Writes a 32-bit value in network order (i.e., MSB 1st) |
| public static int | Returns: The read 32-bit valueThe input, byte[] InputStreamWork buffer to use buf)Read a 32-bit value in network order |
| public static int | Returns: The read 32-bit valueThe input, byte[] InputStreamWork buffer to use buf, int Offset in buffer to us offset, int Available length - must have at least 4 bytes available len)Read a 32-bit value in network order |
| public static long | Returns: The read 32-bit valueThe input, byte[] InputStreamWork buffer to use buf)Read a 32-bit value in network order |
| public static long | Returns: The read 32-bit valueThe input, byte[] InputStreamWork buffer to use buf, int Offset in buffer to us offset, int Available length - must have at least 4 bytes available len)Read a 32-bit value in network order |
| public static String | |
| public static String | |
| public static String | |
| public static String | |
| public static int | Returns: The amount of data that has been encodedThe buffer, int BufferThe offset in the buffer where the length placeholder is to be update - Note: assumption is
that the encoded data starts immediately after the placeholder lenPos)Used for encodings where we don't know the data length before adding it to the buffer. |
| public static void | updateLengthPlaceholder(Buffer
The buffer, int BufferThe offset in the buffer where the length placeholder is to be update - Note: assumption
is that the encoded data starts immediately after the placeholder lenPos, long The length to update - a UINT32 value as a dataLength)longUpdates a 32-bit "placeholder" location for data length - moves the write position to the specified placeholder position, updates the length value and then moves the write position it back to its original value. |
| public static long | |
| public static long | |
| public static long | |
| public static long | |
| public static long | |
| public static long | |
| public static void | writeInt(OutputStream
The output, int OutputStream to write the valueThe 32-bit value value, byte[] A work buffer to use - must have enough space to contain 4 bytes buf)Writes a 32-bit value in network order (i.e., MSB 1st) |
| public static void | writeInt(OutputStream
The output, int OutputStream to write the valueThe 32-bit value value, byte[] A work buffer to use - must have enough space to contain 4 bytes buf, int The offset to write the value off, int The available space len)Writes a 32-bit value in network order (i.e., MSB 1st) |
| public static void | writeUInt(OutputStream
The output, long OutputStream to write the valueThe 32-bit value value, byte[] A work buffer to use - must have enough space to contain 4 bytes buf)Writes a 32-bit value in network order (i.e., MSB 1st) |
| public static void | writeUInt(OutputStream
The output, long OutputStream to write the valueThe 32-bit value value, byte[] A work buffer to use - must have enough space to contain 4 bytes buf, int The offset to write the value off, int The available space len)Writes a 32-bit value in network order (i.e., MSB 1st) |
| DEFAULT_BUFFER_GROWTH_FACTOR | back to summary |
|---|---|
| public static final IntUnaryOperator DEFAULT_BUFFER_GROWTH_FACTOR | |
| DEFAULT_HEX_SEPARATOR | back to summary |
|---|---|
| public static final char DEFAULT_HEX_SEPARATOR | |
| DEFAULT_HEXDUMP_LEVEL | back to summary |
|---|---|
| public static final Level DEFAULT_HEXDUMP_LEVEL | |
| EMPTY_HEX_SEPARATOR | back to summary |
|---|---|
| public static final char EMPTY_HEX_SEPARATOR | |
| HEX_DIGITS | back to summary |
|---|---|
| public static final String HEX_DIGITS | |
| MAX_UINT32_VALUE | back to summary |
|---|---|
| public static final long MAX_UINT32_VALUE Maximum value of a | |
| MAX_UINT8_VALUE | back to summary |
|---|---|
| public static final int MAX_UINT8_VALUE Maximum value of a | |
| BufferUtils | back to summary |
|---|---|
| private BufferUtils() Private Constructor | |
| appendHex | back to summary |
|---|---|
| public static <A extends Appendable> A appendHex(A sb, char sep, byte... array) throws IOException | |
| appendHex | back to summary |
|---|---|
| public static <A extends Appendable> A appendHex(A sb, byte[] array, int offset, int len, char sep) throws IOException | |
| clear | back to summary |
|---|---|
| public static <B extends Buffer> B clear(B buffer) Invokes
| |
| decodeHex | back to summary |
|---|---|
public static byte[] decodeHex(char separator, CharSequence csq)
| |
| decodeHex | back to summary |
|---|---|
public static byte[] decodeHex(char separator, CharSequence csq, int start, int end)
| |
| decodeHex | back to summary |
|---|---|
public static <S extends OutputStream> int decodeHex(S stream, char separator, CharSequence csq) throws IOException
| |
| decodeHex | back to summary |
|---|---|
public static <S extends OutputStream> int decodeHex(S stream, char separator, CharSequence csq, int start, int end) throws IOException
| |
| dumpHex | back to summary |
|---|---|
| public static void dumpHex(SimplifiedLog logger, Level level, String prefix, PropertyResolver resolver, char sep, byte... data) | |
| dumpHex | back to summary |
|---|---|
| public static void dumpHex(SimplifiedLog logger, Level level, String prefix, PropertyResolver resolver, char sep, byte[] data, int offset, int len) | |
| dumpHex | back to summary |
|---|---|
| public static void dumpHex(SimplifiedLog logger, Level level, String prefix, char sep, int chunkSize, byte... data) | |
| dumpHex | back to summary |
|---|---|
| public static void dumpHex(SimplifiedLog logger, Level level, String prefix, char sep, int chunkSize, byte[] data, int offset, int len) | |
| equals | back to summary |
|---|---|
| public static boolean equals(byte[] a1, byte[] a2) Compares the contents of 2 arrays of bytes - Note: do not use it to execute security related comparisons
(e.g. MACs) since the method leaks timing information. Use
| |
| equals | back to summary |
|---|---|
| public static boolean equals(byte[] a1, int a1Offset, byte[] a2, int a2Offset, int length) Compares the contents of 2 arrays of bytes - Note: do not use it to execute security related comparisons
(e.g. MACs) since the method leaks timing information. Use
| |
| fromHex | back to summary |
|---|---|
| public static byte fromHex(char hi, char lo) throws NumberFormatException | |
| fromMPIntBytes | back to summary |
|---|---|
| public static BigInteger fromMPIntBytes(byte[] mpInt) | |
| getInt | back to summary |
|---|---|
public static int getInt(byte[] buf, int off, int len)
| |
| getLong | back to summary |
|---|---|
| public static long getLong(byte[] buf, int off, int len) | |
| getNextPowerOf2 | back to summary |
|---|---|
| public static int getNextPowerOf2(int value) | |
| getUInt | back to summary |
|---|---|
public static long getUInt(byte... buf)
| |
| getUInt | back to summary |
|---|---|
public static long getUInt(byte[] buf, int off, int len)
| |
| indexOf | back to summary |
|---|---|
| public static int indexOf(byte[] array, byte valueToFind, int startIndex, int len) Finds the index of the given value in the array starting at the given index and checking up to specified number of elements.
This method returns
A negative startIndex is treated as zero. A startIndex larger than the array length will return
| |
| isValidInt32Value | back to summary |
|---|---|
| public static boolean isValidInt32Value(long value) | |
| isValidUint32Value | back to summary |
|---|---|
| public static boolean isValidUint32Value(long value) | |
| putLong | back to summary |
|---|---|
| public static int putLong(long value, byte[] buf, int off, int len) | |
| putUInt | back to summary |
|---|---|
| public static int putUInt(long value, byte[] buf) Writes a 32-bit value in network order (i.e., MSB 1st)
| |
| putUInt | back to summary |
|---|---|
| public static int putUInt(long value, byte[] buf, int off, int len) Writes a 32-bit value in network order (i.e., MSB 1st)
| |
| readInt | back to summary |
|---|---|
| public static int readInt(InputStream input, byte[] buf) throws IOException Read a 32-bit value in network order
| |
| readInt | back to summary |
|---|---|
| public static int readInt(InputStream input, byte[] buf, int offset, int len) throws IOException Read a 32-bit value in network order
| |
| readUInt | back to summary |
|---|---|
| public static long readUInt(InputStream input, byte[] buf) throws IOException Read a 32-bit value in network order
| |
| readUInt | back to summary |
|---|---|
| public static long readUInt(InputStream input, byte[] buf, int offset, int len) throws IOException Read a 32-bit value in network order
| |
| toHex | back to summary |
|---|---|
| public static String toHex(byte... array) | |
| toHex | back to summary |
|---|---|
| public static String toHex(char sep, byte... array) | |
| toHex | back to summary |
|---|---|
| public static String toHex(byte[] array, int offset, int len) | |
| toHex | back to summary |
|---|---|
| public static String toHex(byte[] array, int offset, int len, char sep) | |
| updateLengthPlaceholder | back to summary |
|---|---|
| public static int updateLengthPlaceholder(Buffer buffer, int lenPos) Used for encodings where we don't know the data length before adding it to the buffer. The idea is to place a 32-bit "placeholder", encode the data and then return back to the placeholder and update the length. The method calculates the encoded data length, moves the write position to the specified placeholder position, updates the length value and then moves the write position it back to its original value. | |
| updateLengthPlaceholder | back to summary |
|---|---|
| public static void updateLengthPlaceholder(Buffer buffer, int lenPos, long dataLength) Updates a 32-bit "placeholder" location for data length - moves the write position to the specified placeholder position, updates the length value and then moves the write position it back to its original value. | |
| validateInt32Value | back to summary |
|---|---|
| public static long validateInt32Value(long value, String message) | |
| validateInt32Value | back to summary |
|---|---|
| public static long validateInt32Value(long value, String format, Object arg) | |
| validateInt32Value | back to summary |
|---|---|
| public static long validateInt32Value(long value, String format, Object... args) | |
| validateUint32Value | back to summary |
|---|---|
| public static long validateUint32Value(long value, String message) | |
| validateUint32Value | back to summary |
|---|---|
| public static long validateUint32Value(long value, String format, Object arg) | |
| validateUint32Value | back to summary |
|---|---|
| public static long validateUint32Value(long value, String format, Object... args) | |
| writeInt | back to summary |
|---|---|
| public static void writeInt(OutputStream output, int value, byte[] buf) throws IOException Writes a 32-bit value in network order (i.e., MSB 1st)
| |
| writeInt | back to summary |
|---|---|
| public static void writeInt(OutputStream output, int value, byte[] buf, int off, int len) throws IOException Writes a 32-bit value in network order (i.e., MSB 1st)
| |
| writeUInt | back to summary |
|---|---|
| public static void writeUInt(OutputStream output, long value, byte[] buf) throws IOException Writes a 32-bit value in network order (i.e., MSB 1st)
| |
| writeUInt | back to summary |
|---|---|
| public static void writeUInt(OutputStream output, long value, byte[] buf, int off, int len) throws IOException Writes a 32-bit value in network order (i.e., MSB 1st)
| |