| Modifier and Type | Class and Description |
|---|---|
| public static class | ByteUtil.
Utility byte stream similar to ByteArrayOutputStream but with extended accessibility to the bytes. |
| Modifier and Type | Field and Description |
|---|---|
| private static final String[] | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static int | Returns: the byte value converted to an unsigned int valueReturns the byte value converted to an unsigned int value. |
| public static int | Returns: the short value converted to an unsigned int valueReturns the short value converted to an unsigned int value. |
| public static void | |
| public static void | |
| public static void | |
| public static byte[] | |
| public static void | |
| public static byte[] | |
| public static byte[] | copyOf(byte[] arr, int offset, int newLength)
Returns a copy of the given array of the given length starting at the given position. |
| public static byte[] | copyOf(byte[] arr, int offset, int newLength, int dstOffset)
Returns a copy of the given array of the given length starting at the given position. |
| public static void | |
| public static int | Returns: the offset of the pattern if a match is found, -1 otherwiseSearches for a pattern of bytes in the given buffer starting at the given offset. |
| public static int | Returns: the new buffer positionMoves the position of the given buffer the given count from the current position. |
| public static int | Returns: The intBuffer containing the bytes buffer)Read a 3 byte int from a buffer |
| public static int | Returns: The intBuffer containing the bytes buffer, ByteOrder the order of the bytes of the int order)Read a 3 byte int from a buffer |
| public static int | Returns: The intBuffer containing the bytes buffer, int Offset at which to start reading the int offset)Read a 3 byte int from a buffer |
| public static int | Returns: The intBuffer containing the bytes buffer, int Offset at which to start reading the int offset, ByteOrder the order of the bytes of the int order)Read a 3 byte int from a buffer |
| public static byte[] | Returns: a new buffer with the given number of bytes from the current position in the given bufferBuffer containing the desired bytes buffer, int length of the desired bytes len)Reads an array of bytes from the given buffer |
| public static byte[] | Returns: a new buffer with the given number of bytes from the given position in the given bufferBuffer containing the desired bytes buffer, int Offset at which to read the bytes offset, int length of the desired bytes len)Reads an array of bytes from the given buffer at the given offset |
| public static int | Returns: an int from the current position in the given buffer, read using the given ByteOrderBuffer containing the bytes buffer, ByteOrder the order of the bytes of the int order)Returns an int from the current position in the given buffer, read using the given ByteOrder. |
| public static int | Returns: an int from the given position in the given buffer, read using the given ByteOrderBuffer containing the bytes buffer, int Offset at which to start reading the int offset, ByteOrder the order of the bytes of the int order)Returns an int from the given position in the given buffer, read using the given ByteOrder. |
| public static int | Returns: The unsigned byte as an intBuffer containing the bytes buffer)Read an unsigned byte from a buffer |
| public static int | Returns: The unsigned byte as an intBuffer containing the bytes buffer, int Offset at which to read the byte offset)Read an unsigned byte from a buffer |
| public static int | Returns: The unsigned short as an intBuffer containing the short buffer)Read an unsigned short from a buffer |
| public static int | Returns: The unsigned short as an intBuffer containing the short buffer, int Offset at which to read the short offset)Read an unsigned short from a buffer |
| public static int | Returns: The unsigned intBuffer containing the variable length int buffer, int numBytes)Read an unsigned variable length int from a buffer |
| public static int | Returns: The unsigned intBuffer containing the variable length int buffer, int Offset at which to read the value offset, int numBytes)Read an unsigned variable length int from a buffer |
| public static void | insertEmptyData(ByteBuffer buffer, int len)
Inserts empty data of the given length at the current position of the given buffer (moving existing data forward the given length). |
| public static boolean | matchesRange(ByteBuffer buffer, int start, byte[] pattern)
Matches a pattern of bytes against the given buffer starting at the given offset. |
| public static void | put3ByteInt(ByteBuffer
buffer into which to insert the int buffer, int Int to convert val)Put an integer into the given buffer at the given offset as a 3-byte integer. |
| public static void | put3ByteInt(ByteBuffer
buffer into which to insert the int buffer, int Int to convert val, ByteOrder the order to insert the bytes of the int order)Put an integer into the given buffer at the given offset as a 3-byte integer. |
| public static void | put3ByteInt(ByteBuffer
buffer into which to insert the int buffer, int Int to convert val, int offset at which to insert the int offset, ByteOrder the order to insert the bytes of the int order)Put an integer into the given buffer at the given offset as a 3-byte integer. |
| public static void | putInt(ByteBuffer
buffer into which to insert the int buffer, int Int to insert val, ByteOrder the order to insert the bytes of the int order)Writes an int at the current position in the given buffer, using the given ByteOrder |
| public static void | putInt(ByteBuffer
buffer into which to insert the int buffer, int Int to insert val, int offset at which to insert the int offset, ByteOrder the order to insert the bytes of the int order)Writes an int at the given position in the given buffer, using the given ByteOrder |
| public static void | putRange(ByteBuffer buffer, int start, int end, byte b)
Sets all bytes in the given byte range to the given byte value. |
| public static void | |
| public static void | swap2Bytes(byte[]
buffer containing bytes to swap bytes, int offset of the first byte of the bytes to swap offset)Swaps the 2 bytes (changes endianness) of the bytes at the given offset. |
| public static void | swap4Bytes(byte[]
buffer containing bytes to swap bytes, int offset of the first byte of the bytes to swap offset)Swaps the 4 bytes (changes endianness) of the bytes at the given offset. |
| public static void | swap8Bytes(byte[]
buffer containing bytes to swap bytes, int offset of the first byte of the bytes to swap offset)Swaps the 8 bytes (changes endianness) of the bytes at the given offset. |
| private static void | |
| public static void | toHexFile(String fileName, ByteBuffer buffer, int offset, int size)
Writes a chunk of data to a file in pretty printed hexidecimal. |
| public static String | Returns: The display StringBuffer to display, starting at offset 0 buffer, int Number of bytes to read from the buffer size)Convert a byte buffer to a hexadecimal string for display |
| public static String | Returns: The display Stringbyte array to display, starting at offset 0 array)Convert a byte array to a hexadecimal string for display |
| public static String | Returns: The display StringBuffer to display, starting at offset 0 buffer, int Offset at which to start reading the buffer offset, int Number of bytes to read from the buffer size)Convert a byte buffer to a hexadecimal string for display |
| public static String | Returns: The display StringBuffer to display, starting at offset 0 buffer, int Offset at which to start reading the buffer offset, int Number of bytes to read from the buffer size, boolean flag indicating if formatting is required formatted)Convert a byte buffer to a hexadecimal string for display |
| public static String | toHexString(DatabaseImpl db, int pageNumber, int size)
Convert the given number of bytes from the given database page to a hexidecimal string for display. |
| public static void | writeHexString(ByteBuffer buffer, String hexStr)
Writes a sequence of hexidecimal values into the given buffer, where every two characters represent one byte value. |
| HEX_CHARS | back to summary |
|---|---|
| private static final String[] HEX_CHARS | |
| NUM_BYTES_PER_BLOCK | back to summary |
|---|---|
| private static final int NUM_BYTES_PER_BLOCK | |
| NUM_BYTES_PER_LINE | back to summary |
|---|---|
| private static final int NUM_BYTES_PER_LINE | |
| ByteUtil | back to summary |
|---|---|
| private ByteUtil() | |
| asUnsignedByte | back to summary |
|---|---|
| public static int asUnsignedByte(byte b) Returns the byte value converted to an unsigned int value.
| |
| asUnsignedShort | back to summary |
|---|---|
| public static int asUnsignedShort(short s) Returns the short value converted to an unsigned int value.
| |
| clearRange | back to summary |
|---|---|
| public static void clearRange(ByteBuffer buffer, int start, int end) Sets all bits in the given byte range to 0. | |
| clearRemaining | back to summary |
|---|---|
| public static void clearRemaining(ByteBuffer buffer) Sets all bits in the given remaining byte range to 0. | |
| closeQuietly | back to summary |
|---|---|
| public static void closeQuietly(Closeable c) Closes the given
| |
| concat | back to summary |
|---|---|
| public static byte[] concat(byte[] b1, byte[] b2) Concatenates and returns the given byte arrays. | |
| copy | back to summary |
|---|---|
| public static void copy(InputStream in, OutputStream out) throws IOException Copies the given InputStream to the given OutputStream. | |
| copyOf | back to summary |
|---|---|
| public static byte[] copyOf(byte[] arr, int newLength) Returns a copy of the given array of the given length. | |
| copyOf | back to summary |
|---|---|
| public static byte[] copyOf(byte[] arr, int offset, int newLength) Returns a copy of the given array of the given length starting at the given position. | |
| copyOf | back to summary |
|---|---|
| public static byte[] copyOf(byte[] arr, int offset, int newLength, int dstOffset) Returns a copy of the given array of the given length starting at the given position. | |
| fillRange | back to summary |
|---|---|
| public static void fillRange(ByteBuffer buffer, int start, int end) Sets all bits in the given byte range to 1. | |
| findRange | back to summary |
|---|---|
| public static int findRange(ByteBuffer buffer, int start, byte[] pattern) Searches for a pattern of bytes in the given buffer starting at the given offset.
| |
| forward | back to summary |
|---|---|
| public static int forward(ByteBuffer buffer, int count) Moves the position of the given buffer the given count from the current position.
| |
| get3ByteInt | back to summary |
|---|---|
| public static int get3ByteInt(ByteBuffer buffer) Read a 3 byte int from a buffer
| |
| get3ByteInt | back to summary |
|---|---|
| public static int get3ByteInt(ByteBuffer buffer, ByteOrder order) Read a 3 byte int from a buffer
| |
| get3ByteInt | back to summary |
|---|---|
| public static int get3ByteInt(ByteBuffer buffer, int offset) Read a 3 byte int from a buffer
| |
| get3ByteInt | back to summary |
|---|---|
| public static int get3ByteInt(ByteBuffer buffer, int offset, ByteOrder order) Read a 3 byte int from a buffer
| |
| getBytes | back to summary |
|---|---|
| public static byte[] getBytes(ByteBuffer buffer, int len) Reads an array of bytes from the given buffer
| |
| getBytes | back to summary |
|---|---|
| public static byte[] getBytes(ByteBuffer buffer, int offset, int len) Reads an array of bytes from the given buffer at the given offset
| |
| getInt | back to summary |
|---|---|
| public static int getInt(ByteBuffer buffer, ByteOrder order) Returns an int from the current position in the given buffer, read using the given ByteOrder.
| |
| getInt | back to summary |
|---|---|
| public static int getInt(ByteBuffer buffer, int offset, ByteOrder order) Returns an int from the given position in the given buffer, read using the given ByteOrder.
| |
| getUnsignedByte | back to summary |
|---|---|
| public static int getUnsignedByte(ByteBuffer buffer) Read an unsigned byte from a buffer
| |
| getUnsignedByte | back to summary |
|---|---|
| public static int getUnsignedByte(ByteBuffer buffer, int offset) Read an unsigned byte from a buffer
| |
| getUnsignedShort | back to summary |
|---|---|
| public static int getUnsignedShort(ByteBuffer buffer) Read an unsigned short from a buffer
| |
| getUnsignedShort | back to summary |
|---|---|
| public static int getUnsignedShort(ByteBuffer buffer, int offset) Read an unsigned short from a buffer
| |
| getUnsignedVarInt | back to summary |
|---|---|
| public static int getUnsignedVarInt(ByteBuffer buffer, int numBytes) Read an unsigned variable length int from a buffer
| |
| getUnsignedVarInt | back to summary |
|---|---|
| public static int getUnsignedVarInt(ByteBuffer buffer, int offset, int numBytes) Read an unsigned variable length int from a buffer
| |
| insertEmptyData | back to summary |
|---|---|
| public static void insertEmptyData(ByteBuffer buffer, int len) Inserts empty data of the given length at the current position of the given buffer (moving existing data forward the given length). The limit of the buffer is adjusted by the given length. The buffer is expecting to have the required capacity available. | |
| matchesRange | back to summary |
|---|---|
| public static boolean matchesRange(ByteBuffer buffer, int start, byte[] pattern) Matches a pattern of bytes against the given buffer starting at the given offset. | |
| put3ByteInt | back to summary |
|---|---|
| public static void put3ByteInt(ByteBuffer buffer, int val) Put an integer into the given buffer at the given offset as a 3-byte integer.
| |
| put3ByteInt | back to summary |
|---|---|
| public static void put3ByteInt(ByteBuffer buffer, int val, ByteOrder order) Put an integer into the given buffer at the given offset as a 3-byte integer.
| |
| put3ByteInt | back to summary |
|---|---|
| public static void put3ByteInt(ByteBuffer buffer, int val, int offset, ByteOrder order) Put an integer into the given buffer at the given offset as a 3-byte integer.
| |
| putInt | back to summary |
|---|---|
| public static void putInt(ByteBuffer buffer, int val, ByteOrder order) Writes an int at the current position in the given buffer, using the given ByteOrder
| |
| putInt | back to summary |
|---|---|
| public static void putInt(ByteBuffer buffer, int val, int offset, ByteOrder order) Writes an int at the given position in the given buffer, using the given ByteOrder
| |
| putRange | back to summary |
|---|---|
| public static void putRange(ByteBuffer buffer, int start, int end, byte b) Sets all bytes in the given byte range to the given byte value. | |
| skipFully | back to summary |
|---|---|
| public static void skipFully(DataInputStream din, int len) throws IOException Skips the given number of bytes in the given stream | |
| swap2Bytes | back to summary |
|---|---|
| public static void swap2Bytes(byte[] bytes, int offset) Swaps the 2 bytes (changes endianness) of the bytes at the given offset.
| |
| swap4Bytes | back to summary |
|---|---|
| public static void swap4Bytes(byte[] bytes, int offset) Swaps the 4 bytes (changes endianness) of the bytes at the given offset.
| |
| swap8Bytes | back to summary |
|---|---|
| public static void swap8Bytes(byte[] bytes, int offset) Swaps the 8 bytes (changes endianness) of the bytes at the given offset.
| |
| swapBytesAt | back to summary |
|---|---|
| private static void swapBytesAt(byte[] bytes, int p1, int p2) Swaps the bytes at the given positions. | |
| toHexFile | back to summary |
|---|---|
| public static void toHexFile(String fileName, ByteBuffer buffer, int offset, int size) throws IOException Writes a chunk of data to a file in pretty printed hexidecimal.
| |
| toHexString | back to summary |
|---|---|
| public static String toHexString(ByteBuffer buffer, int size) Convert a byte buffer to a hexadecimal string for display
| |
| toHexString | back to summary |
|---|---|
| public static String toHexString(byte[] array) Convert a byte array to a hexadecimal string for display
| |
| toHexString | back to summary |
|---|---|
| public static String toHexString(ByteBuffer buffer, int offset, int size) Convert a byte buffer to a hexadecimal string for display
| |
| toHexString | back to summary |
|---|---|
| public static String toHexString(ByteBuffer buffer, int offset, int size, boolean formatted) Convert a byte buffer to a hexadecimal string for display
| |
| toHexString | back to summary |
|---|---|
| public static String toHexString(DatabaseImpl db, int pageNumber, int size) throws IOException Convert the given number of bytes from the given database page to a hexidecimal string for display. | |
| writeHexString | back to summary |
|---|---|
| public static void writeHexString(ByteBuffer buffer, String hexStr) throws IOException Writes a sequence of hexidecimal values into the given buffer, where every two characters represent one byte value. | |
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected void | |
| public byte | |
| public byte[] | |
| public int | |
| public void | |
| public void | |
| public void | |
| public void | |
| public byte[] | |
| public void | |
| public void | write(int b)
Implements abstract java. Writes the specified byte to this output stream. |
| public void | write(byte[] b)
Overrides java. Writes |
| public void | write(byte[] b, int offset, int len)
Overrides java. Writes |
| public void | |
| public void |
| bytes | back to summary |
|---|---|
| private byte[] bytes | |
| lastLength | back to summary |
|---|---|
| private int lastLength | |
| length | back to summary |
|---|---|
| private int length | |
| ByteStream | back to summary |
|---|---|
| public ByteStream() | |
| ByteStream | back to summary |
|---|---|
| public ByteStream(int capacity) | |
| ensureCapacity | back to summary |
|---|---|
| protected void ensureCapacity(int newLength) | |
| ensureNewCapacity | back to summary |
|---|---|
| protected void ensureNewCapacity(int numBytes) | |
| get | back to summary |
|---|---|
| public byte get(int offset) | |
| getBytes | back to summary |
|---|---|
| public byte[] getBytes() | |
| getLength | back to summary |
|---|---|
| public int getLength() | |
| reset | back to summary |
|---|---|
| public void reset() | |
| set | back to summary |
|---|---|
| public void set(int offset, byte b) | |
| setBits | back to summary |
|---|---|
| public void setBits(int offset, byte b) | |
| skip | back to summary |
|---|---|
| public void skip(int n) | |
| toByteArray | back to summary |
|---|---|
| public byte[] toByteArray() | |
| trimTrailing | back to summary |
|---|---|
| public void trimTrailing(byte minTrimCode, byte maxTrimCode) | |
| write | back to summary |
|---|---|
| public void write(int b) Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(byte[] b) Overrides java. Doc from java. Writes
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int offset, int len) Overrides java. Doc from java. Writes
If
If
| |
| writeFill | back to summary |
|---|---|
| public void writeFill(int len, byte b) | |
| writeTo | back to summary |
|---|---|
| public void writeTo(ByteUtil. | |