| java.lang.Object com.quadcap.sql.file.ByteUtil
ByteUtil | public class ByteUtil (Code) | | This class encapsulates various utilities for manipulating byte arrays
which contain primitive values, such as integers, strings, etc.
author: Stan Bailes |
Method Summary | |
final public static int | getInt(byte[] buf, int pos) Get the four-byte integer stored at the specified location in the
buffer. | final public static long | getLong(byte[] buf, int pos) Get the eight-byte long stored at the specified location in the
buffer. | final public static short | getShort(byte[] buf, int pos) Get the two-byte short stored at the specified location in the
buffer. | final public static void | putInt(byte[] buf, int pos, int val) | final public static void | putLong(byte[] buf, int pos, long val) | final public static void | putShort(byte[] buf, int pos, short val) |
getInt | final public static int getInt(byte[] buf, int pos)(Code) | | Get the four-byte integer stored at the specified location in the
buffer.
Parameters: buf - the buffer from which the integer is read. Parameters: pos - the position in the buffer. |
getLong | final public static long getLong(byte[] buf, int pos)(Code) | | Get the eight-byte long stored at the specified location in the
buffer.
Parameters: buf - the buffer from which the long is read. Parameters: pos - the position in the buffer. |
getShort | final public static short getShort(byte[] buf, int pos)(Code) | | Get the two-byte short stored at the specified location in the
buffer.
Parameters: buf - the buffer from which the short is read. Parameters: pos - the position in the buffer. |
putInt | final public static void putInt(byte[] buf, int pos, int val)(Code) | | Write an integer value as four bytes (MSB first) into the buffer
Parameters: buf - the buffer Parameters: pos - the byte offset of the first value Parameters: val - the value to write to the buffer |
putLong | final public static void putLong(byte[] buf, int pos, long val)(Code) | | Write an long value as eight bytes (MSB first) into the buffer
Parameters: buf - the buffer Parameters: pos - the byte offset of the first value Parameters: val - the value to write to the buffer |
putShort | final public static void putShort(byte[] buf, int pos, short val)(Code) | | Write an short value as two bytes (MSB first) into the buffer
Parameters: buf - the buffer Parameters: pos - the byte offset of the first value Parameters: val - the value to write to the buffer |
|
|