| Modifier and Type | Class and Description |
|---|---|
| public static interface | ByteUtils.ByteConsumer
Used to consume bytes. |
| public static interface | ByteUtils.ByteSupplier
Used to supply bytes. |
| public static class | |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final byte[] | EMPTY_BYTE_ARRAY
Empty array. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| public static long | Returns: the number readthe byte array to convert bytes)Reads the given byte array as a little-endian long. |
| public static long | Returns: the number readthe byte array to convert bytes, final int the offset into the array that starts the value off, final int the number of bytes representing the value length)Reads the given byte array as a little-endian long. |
| public static long | Returns: the number readthe supplier for bytes supplier,the number of bytes representing the value length)Reads the given number of bytes from the given supplier as a little-endian long. |
| public static long | Returns: the number readthe input to read from in, final int the number of bytes representing the value length)Reads the given number of bytes from the given input as little-endian long. |
| public static long | Returns: the number readthe stream to read from in, final int the number of bytes representing the value length)
Deprecated
Unused
Reads the given number of bytes from the given stream as a little-endian long.
|
| public static void | toLittleEndian(final byte[]
the array to write into b, final long the value to insert value, final int the offset into the array that receives the first byte off, final int the number of bytes to use to represent the value length)Inserts the given value into the array as a little-endian sequence of the given length starting at the given offset. |
| public static void | toLittleEndian(final ByteUtils.
the consumer to provide the bytes to consumer,the value to provide value, final int the number of bytes to use to represent the value length)Provides the given value to the given consumer as a little-endian sequence of the given length. |
| public static void | toLittleEndian(final DataOutput
the output to write to out, final long the value to write value, final int the number of bytes to use to represent the value length)
Deprecated
Unused
Writes the given value to the given stream as a little-endian array of the given length.
|
| public static void | toLittleEndian(final OutputStream
the stream to write to out, final long the value to write value, final int the number of bytes to use to represent the value length)Writes the given value to the given stream as a little-endian array of the given length. |
| EMPTY_BYTE_ARRAY | back to summary |
|---|---|
| public static final byte[] EMPTY_BYTE_ARRAY Empty array.
| |
| ByteUtils | back to summary |
|---|---|
| private ByteUtils() | |
| checkReadLength | back to summary |
|---|---|
| private static void checkReadLength(final int length) | |
| fromLittleEndian | back to summary |
|---|---|
| public static long fromLittleEndian(final byte[] bytes) Reads the given byte array as a little-endian long.
| |
| fromLittleEndian | back to summary |
|---|---|
| public static long fromLittleEndian(final byte[] bytes, final int off, final int length) Reads the given byte array as a little-endian long.
| |
| fromLittleEndian | back to summary |
|---|---|
| public static long fromLittleEndian(final ByteUtils. Reads the given number of bytes from the given supplier as a little-endian long. Typically used by our InputStreams that need to count the bytes read as well.
| |
| fromLittleEndian | back to summary |
|---|---|
| public static long fromLittleEndian(final DataInput in, final int length) throws IOException Reads the given number of bytes from the given input as little-endian long.
| |
| fromLittleEndian | back to summary |
|---|---|
| public static long fromLittleEndian(final InputStream in, final int length) throws IOException
Deprecated Unused Reads the given number of bytes from the given stream as a little-endian long.
| |
| toLittleEndian | back to summary |
|---|---|
| public static void toLittleEndian(final byte[] b, final long value, final int off, final int length) Inserts the given value into the array as a little-endian sequence of the given length starting at the given offset.
| |
| toLittleEndian | back to summary |
|---|---|
| public static void toLittleEndian(final ByteUtils. Provides the given value to the given consumer as a little-endian sequence of the given length.
| |
| toLittleEndian | back to summary |
|---|---|
| public static void toLittleEndian(final DataOutput out, final long value, final int length) throws IOException
Deprecated Unused Writes the given value to the given stream as a little-endian array of the given length.
| |
| toLittleEndian | back to summary |
|---|---|
| public static void toLittleEndian(final OutputStream out, final long value, final int length) throws IOException Writes the given value to the given stream as a little-endian array of the given length.
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(int
the byte to consume b)The contract is similar to |
| accept | back to summary |
|---|---|
| public void accept(int b) throws IOException The contract is similar to
| |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the supplied byte or -1 if there are no more bytesThe contract is similar to |
| getAsByte | back to summary |
|---|---|
| public int getAsByte() throws IOException The contract is similar to
| |
Deprecated
Unused
ByteSupplier based on InputStream.
| Modifier and Type | Field and Description |
|---|---|
| private final InputStream |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | getAsByte()
Implements org. InputStream#read(), return the byte as an unsigned int, -1 if there are no more bytes.
|
| is | back to summary |
|---|---|
| private final InputStream is | |
| InputStreamByteSupplier | back to summary |
|---|---|
| public InputStreamByteSupplier(final InputStream is) | |
| getAsByte | back to summary |
|---|---|
| public int getAsByte() throws IOException Implements org. Doc from org. The contract is similar to
| |
ByteConsumer based on OutputStream.
| Modifier and Type | Field and Description |
|---|---|
| private final OutputStream |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(final int
the byte to consume b)Implements org. OutputStream#write(int), consume the lower eight bytes of the int as a byte.
|
| os | back to summary |
|---|---|
| private final OutputStream os | |
| OutputStreamByteConsumer | back to summary |
|---|---|
| public OutputStreamByteConsumer(final OutputStream os) | |
| accept | back to summary |
|---|---|
| public void accept(final int b) throws IOException Implements org. Doc from org. The contract is similar to
| |