com.tivoli.twg.libs
Class IntelByteBuffer

java.lang.Object
  extended bycom.tivoli.twg.libs.IntelByteBuffer
Direct Known Subclasses:
CmdPacket

public class IntelByteBuffer
extends java.lang.Object

Class for creating or interpreting byte arrays representing Intel byte order structures with C-type data types. Class is not "thread safe", so if buffer will be concurrently accessed by multiple threads, accesses should be synchronized.


Field Summary
static int SIZEOF_CHAR
           
static int SIZEOF_DOUBLE
           
static int SIZEOF_FLOAT
           
static int SIZEOF_LONG
           
static int SIZEOF_LONG64
          Size of various Intel data types
static int SIZEOF_SHORT
           
static int SIZEOF_UCHAR
           
static int SIZEOF_ULONG
           
static int SIZEOF_UNICODE
           
static int SIZEOF_USHORT
           
 
Constructor Summary
IntelByteBuffer(byte[] inbuf)
          Constructor for interpreting a provided byte array.
IntelByteBuffer(byte[] inbuf, int start_off)
          Constructor for interpreting a provided byte array, with offsets relative to a provided offset.
IntelByteBuffer(int buflen)
          Constructor for building a new byte array with a given length.
 
Method Summary
static java.lang.String BytesToString(byte[] buffer)
          Convert bytes in a byte array to a string of hexadecimal digits.
static java.lang.String BytesToString(byte[] buffer, int start, int len)
          Convert range of bytes in a byte array to a string of hexadecimal digits.
static int GetASCIIZLength(java.lang.String val)
          Get length of ASCIIZ version of string, in bytes ASCIIZ strings are limited to character codes 0000-007f
 byte[] GetBuffer()
          Get byte buffer
static int GetCompUnicodeLength(java.lang.String val)
          Get length of compressed unicode version of string, in bytes
static int GetEncodedUTF8Length(byte[] buf, int off)
          Test for valid UTF-8 encoded string, and return length
static int GetIntValueSetLength(IntValueSet valset)
          Get length needed for IntValueSet
static int GetLengthEncodedLong64ArrayLength(long[] val, int start, int len)
          Get length needed for length encodeding given array as Long64s
static int GetLengthEncodedLONGArrayLength(int[] val, int start, int len)
          Get length needed for length encodeding given array as LONGs
static int GetLengthEncodedULONGArrayLength(long[] val, int start, int len)
          Get length needed for length encodeding given array as ULONGs
static int GetLongValueSetLength(LongValueSet valset)
          Get length needed for LongValueSet
 int GetOffset()
          Get current offset index (relative to start)
 int GetStart()
          Get start index
static int GetStringValueSetLength(StringValueSet valset)
          Get length needed for StringValueSet
static byte[] GetUTF8(java.lang.String s)
          Get UTF-8 encoding of string
static int GetUTF8Length(java.lang.String s)
          Get length needed to encode string in UTF-8
static void printBytes(byte[] buf)
          Print bytes to System.out (for debug)
static void printBytes(byte[] buf, int begin, int len)
          Print bytes to System.out (for debug)
 java.lang.String ReadASCIIZ()
          Read ASCIIZ string at current offset, advance, return as String.
static java.lang.String ReadASCIIZ(byte[] buffer, int off)
          Read ASCIIZ string at selected offset in given buffer, return as String.
 java.lang.String ReadASCIIZ(int off)
          Read ASCIIZ string at selected offset, return as String.
 byte ReadCHAR()
          Read CHAR from current offset, and advance offset
static byte ReadCHAR(byte[] buffer, int off)
          Read CHAR from selected offset in given buffer.
 byte ReadCHAR(int off)
          Read CHAR from selected offset.
static byte[] ReadCHARArray(byte[] buffer, int off, int len)
          Read byte array from selected offset in given buffer.
 byte[] ReadCHARArray(int len)
          Read byte array from current offset, and advance offset
 byte[] ReadCHARArray(int off, int len)
          Read byte array from selected offset.
 java.lang.String ReadCompUnicode()
          Read compressed unicode string at current offset, advance, return as String.
static java.lang.String ReadCompUnicode(byte[] buffer, int off)
          Read compressed unicode string at selected offset in given buffer, return as String.
 java.lang.String ReadCompUnicode(int off)
          Read compressed unicode string at selected offset, return as String.
 double ReadDouble()
          Read double from current offset, and advance offset
static double ReadDouble(byte[] buffer, int off)
          Read double from selected offset from given buffer.
 double ReadDouble(int off)
          Read double from selected offset.
static double[] ReadDoubleArray(byte[] buffer, int off, int len)
          Read double array from selected offset in given buffer.
 double[] ReadDoubleArray(int len)
          Read double array from current offset, and advance offset
 double[] ReadDoubleArray(int off, int len)
          Read double array from selected offset.
 float ReadFloat()
          Read float from current offset, and advance offset
static float ReadFloat(byte[] buffer, int off)
          Read float from selected offset in given buffer.
 float ReadFloat(int off)
          Read float from selected offset.
static float[] ReadFloatArray(byte[] buffer, int off, int len)
          Read float array from selected offset in given buffer.
 float[] ReadFloatArray(int len)
          Read float array from current offset, and advance offset
 float[] ReadFloatArray(int off, int len)
          Read float from selected offset.
 IntValueSet ReadIntValueSet()
          Read IntValueSet, and advance offset.
static IntValueSet ReadIntValueSet(byte[] buffer, int off)
          Read IntValueSet from selected offset in given buffer.
 IntValueSet ReadIntValueSet(int off)
          Read IntValueSet from selected offset.
 int ReadLONG()
          Read LONG from current offset, and advance offset
static int ReadLONG(byte[] buffer, int off)
          Read LONG from selected offset in given buffer.
 int ReadLONG(int off)
          Read LONG from selected offset.
 long ReadLong64()
          Read 64-bit long from current offset, and advance offset
static long ReadLong64(byte[] buffer, int off)
          Read 64-bit long from selected offset in given buffer.
 long ReadLong64(int off)
          Read 64-bit long from selected offset.
static long[] ReadLong64Array(byte[] buffer, int off, int len)
          Read 64-bit long array from selected offset in given buffer.
 long[] ReadLong64Array(int len)
          Read 64-bit long array from current offset, and advance offset
 long[] ReadLong64Array(int off, int len)
          Read 64-bit long array from selected offset.
static long[] ReadLong64LengthEncodedArray(byte[] buffer, int off, int len)
          Read Long64 array in length-encoded format from selected offset in given buffer.
 long[] ReadLong64LengthEncodedArray(int len)
          Read Long64 array in length-encoded format, and advance offset.
 long[] ReadLong64LengthEncodedArray(int off, int len)
          Read Long64 array in length-encoded format from selected offset.
static int[] ReadLONGArray(byte[] buffer, int off, int len)
          Read LONG array from selected offset in given buffer.
 int[] ReadLONGArray(int len)
          Read LONG array from current offset, and advance offset
 int[] ReadLONGArray(int off, int len)
          Read LONG array from selected offset.
static int[] ReadLONGLengthEncodedArray(byte[] buffer, int off, int len)
          Read LONG array in length-encoded format from selected offset in given buffer.
 int[] ReadLONGLengthEncodedArray(int len)
          Read LONG array in length-encoded format, and advance offset.
 int[] ReadLONGLengthEncodedArray(int off, int len)
          Read LONG array in length-encoded format from selected offset.
 LongValueSet ReadLongValueSet()
          Read LongValueSet, and advance offset.
static LongValueSet ReadLongValueSet(byte[] buffer, int off)
          Read LongValueSet from selected offset in given buffer.
 LongValueSet ReadLongValueSet(int off)
          Read LongValueSet from selected offset.
 short ReadSHORT()
          Read SHORT from current offset, and advance offset
static short ReadSHORT(byte[] buffer, int off)
          Read SHORT from selected offset from given buffer.
 short ReadSHORT(int off)
          Read SHORT from selected offset.
static short[] ReadSHORTArray(byte[] buffer, int off, int len)
          Read SHORT array from selected offset in given buffer.
 short[] ReadSHORTArray(int len)
          Read SHORT array from current offset, and advance offset
 short[] ReadSHORTArray(int off, int len)
          Read SHORT array from selected offset.
 StringValueSet ReadStringValueSet()
          Read StringValueSet, and advance offset.
static StringValueSet ReadStringValueSet(byte[] buffer, int off)
          Read StringValueSet from selected offset in given buffer.
 StringValueSet ReadStringValueSet(int off)
          Read StringValueSet from selected offset.
 short ReadUCHAR()
          Read UCHAR from current offset, and advance offset
static short ReadUCHAR(byte[] buffer, int off)
          Read UCHAR from selected offset in given buffer.
 short ReadUCHAR(int off)
          Read UCHAR from selected offset.
static int[] ReadUCHARArray(byte[] buffer, int off, int len)
          Read UCHAR array from selected offset of given buffer
 int[] ReadUCHARArray(int len)
          Read UCHAR array from current offset, and advance offset
 int[] ReadUCHARArray(int off, int len)
          Read UCHAR array from selected offset.
 long ReadULONG()
          Read ULONG from current offset, and advance offset
static long ReadULONG(byte[] buffer, int off)
          Read ULONG from selected offset in byte array.
 long ReadULONG(int off)
          Read ULONG from selected offset.
static long[] ReadULONGArray(byte[] buffer, int off, int len)
          Read ULONG array from selected offset in given buffer.
 long[] ReadULONGArray(int len)
          Read ULONG array from current offset, and advance offset
 long[] ReadULONGArray(int off, int len)
          Read ULONG array from selected offset.
static long[] ReadULONGLengthEncodedArray(byte[] buffer, int off, int len)
          Read ULONG array in length-encoded format from selected offset in given buffer.
 long[] ReadULONGLengthEncodedArray(int len)
          Read ULONG array in length-encoded format, and advance offset.
 long[] ReadULONGLengthEncodedArray(int off, int len)
          Read ULONG array in length-encoded format from selected offset.
 int ReadUnicode()
          Read unicode char from current offset, and advance offset
static char ReadUnicode(byte[] buffer, int off)
          Read unicode char from selected offset in given buffer.
 char ReadUnicode(int off)
          Read unicode char from selected offset.
static char[] ReadUnicodeArray(byte[] buffer, int off, int len)
          Read unicode char array from selected offset in given buffer.
 char[] ReadUnicodeArray(int len)
          Read unicode char array from current offset, and advance offset
 char[] ReadUnicodeArray(int off, int len)
          Read unicode char array from selected offset.
 int ReadUSHORT()
          Read USHORT from current offset, and advance offset
static int ReadUSHORT(byte[] buffer, int off)
          Read USHORT from selected offset in given buffer.
 int ReadUSHORT(int off)
          Read USHORT from selected offset.
static int[] ReadUSHORTArray(byte[] buffer, int off, int len)
          Read USHORT array from selected offset in given buffer.
 int[] ReadUSHORTArray(int len)
          Read USHORT array from current offset, and advance offset
 int[] ReadUSHORTArray(int off, int len)
          Read USHORT array from selected offset.
 java.lang.String ReadUTF8()
          Read UTF-8 encoded string at current offset, advance, return as String.
static java.lang.String ReadUTF8(byte[] buf, int off)
          Read UTF-8 encoded string from given buffer
 void ResetStart(int s)
          Reset start index and offset
 void ResizeBuffer(int newlen)
          Resize byte buffer and preserve all remaining data.
 void SetBuffer(byte[] b)
          Set byte buffer
 void SetOffset(int off)
          Set current offset index (relative to start)
 void SetStart(int s)
          Set start index
 void SkipASCIIZ()
          Skip over ASCIIZ string at current offset, just advance offset.
static int SkipASCIIZ(byte[] buffer, int off)
          Skip over ASCIIZ string at given offset in given buffer ASCIIZ strings are limited to character codes 0000-007f
 void SkipCompUnicode()
          Skip over compressed unicode string at current offset, just advance offset.
static int SkipCompUnicode(byte[] buffer, int off)
          Skip over compressed unicode string at given offset in given buffer,
 void SkipIntValueSet()
          Skip over IntValueSet at current offset, just advance offset.
static int SkipIntValueSet(byte[] buffer, int off)
          Skip over IntValueSet at given offset in given buffer,
static int SkipLengthEncodedLong64Array(byte[] buffer, int off, int len)
          Skip over length encoded Long64 array at given offset in given buffer,
 void SkipLengthEncodedLong64Array(int len)
          Skip over length encoded Long64 array at current offset, just advance offset.
static int SkipLengthEncodedLONGArray(byte[] buffer, int off, int len)
          Skip over length encoded LONG array at given offset in given buffer,
 void SkipLengthEncodedLONGArray(int len)
          Skip over length encoded LONG array at current offset, just advance offset.
static int SkipLengthEncodedULONGArray(byte[] buffer, int off, int len)
          Skip over length encoded ULONG array at given offset in given buffer,
 void SkipLengthEncodedULONGArray(int len)
          Skip over length encoded ULONG array at current offset, just advance offset.
 void SkipLongValueSet()
          Skip over LongValueSet at current offset, just advance offset.
static int SkipLongValueSet(byte[] buffer, int off)
          Skip over LongValueSet at given offset in given buffer,
 void SkipStringValueSet()
          Skip over StringValueSet at current offset, just advance offset.
static int SkipStringValueSet(byte[] buffer, int off)
          Skip over StringValueSet at given offset in given buffer,
 void SkipUTF8()
          Skip over UTF-8 encoded string at current offset, just advance offset.
static int SkipUTF8(byte[] buf, int off)
          Skip over UTF-8 encoded string at given offset in given buffer
 void StepOffset(int s)
          Step current offset index (relative to start)
 void StepStart(int s)
          Step start index and reset offset
static int WriteASCIIZ(byte[] buffer, java.lang.String val, int off)
          Write string as ASCIIZ at selected offset in given buffer.
 int WriteASCIIZ(java.lang.String val)
          Write string as ASCIIZ at current offset, and advance offset ASCIIZ strings are limited to character codes 0000-007f
 int WriteASCIIZ(java.lang.String val, int off)
          Write string as ASCIIZ at selected offset.
static int WriteCHAR(byte[] buffer, int val, int off)
          Write CHAR at selected offset in given buffer.
 int WriteCHAR(int val)
          Write CHAR at current offset, and advance offset
 int WriteCHAR(int val, int off)
          Write CHAR at selected offset.
 int WriteCHARArray(byte[] val)
          Write byte array at current offset, and advance offset
static int WriteCHARArray(byte[] buffer, byte[] val, int off)
          Write byte array at selected offset in given buffer.
static int WriteCHARArray(byte[] buffer, byte[] val, int start, int len, int off)
          Write byte array at selected offset in given buffer.
 int WriteCHARArray(byte[] val, int off)
          Write byte array at selected offset.
 int WriteCHARArray(byte[] val, int source_off, int len)
          Write byte array of specified length at current offset and advance offset
static int WriteCompUnicode(byte[] buffer, java.lang.String val, int off)
          Write string as compressed unicode at selected offset in given buffer.
 int WriteCompUnicode(java.lang.String val)
          Write string as compressed unicode at current offset, and advance offset
 int WriteCompUnicode(java.lang.String val, int off)
          Write string as compressed unicode at selected offset.
static int WriteDouble(byte[] buffer, double val, int off)
          Write double at selected offset in given buffer.
 int WriteDouble(double val)
          Write double at current offset, and advance offset
 int WriteDouble(double val, int off)
          Write double at selected offset.
static int WriteDoubleArray(byte[] buffer, double[] val, int off)
          Write double array at selected offset in given array.
static int WriteDoubleArray(byte[] buffer, double[] val, int start, int len, int off)
          Write double array at selected offset in given buffer.
 int WriteDoubleArray(double[] val)
          Write double long array at current offset, and advance offset
 int WriteDoubleArray(double[] val, int off)
          Write double array at selected offset.
static int WriteFloat(byte[] buffer, float val, int off)
          Write float at selected offset in given buffer.
 float WriteFloat(float val)
          Write float at current offset, and advance offset
 int WriteFloat(float val, int off)
          Write float at selected offset.
static int WriteFloatArray(byte[] buffer, float[] val, int off)
          Write float array at selected offset in given array.
static int WriteFloatArray(byte[] buffer, float[] val, int start, int len, int off)
          Write float array at selected offset in given buffer.
 int WriteFloatArray(float[] val)
          Write float array at current offset, and advance offset
 int WriteFloatArray(float[] val, int off)
          Write float array at selected offset.
static int WriteIntValueSet(byte[] buffer, IntValueSet valset, int off)
          Write IntValueSet at selected offset in given buffer.
 int WriteIntValueSet(IntValueSet val)
          Write IntValueSet at current offset, and advance.
 int WriteIntValueSet(IntValueSet val, int off)
          Write IntValueSet at selected offset.
static int WriteLONG(byte[] buffer, int val, int off)
          Write LONG at selected offset in given buffer.
 int WriteLONG(int val)
          Write LONG at current offset, and advance offset
 int WriteLONG(int val, int off)
          Write LONG at selected offset.
static int WriteLong64(byte[] buffer, long val, int off)
          Write 64-bit long at selected offset in given buffer.
 int WriteLong64(long val)
          Write 64-bit long at current offset, and advance offset
 int WriteLong64(long val, int off)
          Write 64-bit long at selected offset.
static int WriteLong64Array(byte[] buffer, long[] val, int off)
          Write 64-bit long array at selected offset in given array.
static int WriteLong64Array(byte[] buffer, long[] val, int start, int len, int off)
          Write LONG array at selected offset in given buffer.
 int WriteLong64Array(long[] val)
          Write 64-bit long array at current offset, and advance offset
 int WriteLong64Array(long[] val, int off)
          Write 64-bit long array at selected offset.
static int WriteLong64ArrayLengthEncoded(byte[] buffer, long[] val, int off)
          Write Long64 array length encoded at selected offset in given buffer.
static int WriteLong64ArrayLengthEncoded(byte[] buffer, long[] val, int start, int len, int off)
          Write Long64 array length encoded at selected offset in given buffer.
 int WriteLong64ArrayLengthEncoded(long[] val)
          Write Long64 array length encoded at current offset, and advance.
 int WriteLong64ArrayLengthEncoded(long[] val, int off)
          Write Long64 array length encoded at selected offset.
static int WriteLONGArray(byte[] buffer, int[] val, int off)
          Write LONG array at selected offset in given array.
static int WriteLONGArray(byte[] buffer, int[] val, int start, int len, int off)
          Write LONG array at selected offset in given buffer.
 int WriteLONGArray(int[] val)
          Write LONG array at current offset, and advance offset
 int WriteLONGArray(int[] val, int off)
          Write LONG array at selected offset.
static int WriteLONGArrayLengthEncoded(byte[] buffer, int[] val, int off)
          Write LONG array length encoded at selected offset in given buffer.
static int WriteLONGArrayLengthEncoded(byte[] buffer, int[] val, int start, int len, int off)
          Write LONG array length encoded at selected offset in given buffer.
 int WriteLONGArrayLengthEncoded(int[] val)
          Write LONG array length encoded at current offset, and advance.
 int WriteLONGArrayLengthEncoded(int[] val, int off)
          Write LONG array length encoded at selected offset.
static int WriteLongValueSet(byte[] buffer, LongValueSet valset, int off)
          Write LongValueSet at selected offset in given buffer.
 int WriteLongValueSet(LongValueSet val)
          Write LongValueSet at current offset, and advance.
 int WriteLongValueSet(LongValueSet val, int off)
          Write LongValueSet at selected offset.
static int WriteSHORT(byte[] buffer, int val, int off)
          Write SHORT at selected offset in given buffer.
 int WriteSHORT(int val)
          Write SHORT at current offset, and advance offset
 int WriteSHORT(int val, int off)
          Write SHORT at selected offset.
static int WriteSHORTArray(byte[] buffer, short[] val, int off)
          Write SHORT array at selected offset in given buffer.
static int WriteSHORTArray(byte[] buffer, short[] val, int start, int len, int off)
          Write short array at selected offset in given buffer.
 int WriteSHORTArray(short[] val)
          Write SHORT at current offset, and advance offset
 int WriteSHORTArray(short[] val, int off)
          Write SHORT array at selected offset.
static int WriteStringValueSet(byte[] buffer, StringValueSet valset, int off)
          Write StringValueSet at selected offset in given buffer.
 int WriteStringValueSet(StringValueSet val)
          Write StringValueSet at current offset, and advance.
 int WriteStringValueSet(StringValueSet val, int off)
          Write StringValueSet at selected offset.
static int WriteUCHAR(byte[] buffer, int val, int off)
          Write UCHAR at selected offset in given buffer.
 int WriteUCHAR(int val)
          Write UCHAR at current offset, and advance offset
 int WriteUCHAR(int val, int off)
          Write UCHAR at selected offset.
static int WriteUCHARArray(byte[] buffer, int[] val, int off)
          Write UCHAR array at selected offset in given buffer.
static int WriteUCHARArray(byte[] buffer, int[] val, int start, int len, int off)
          Write byte array at selected offset in given buffer.
 int WriteUCHARArray(int[] val)
          Write UCHAR array at current offset, and advance offset
 int WriteUCHARArray(int[] val, int off)
          Write UCHAR array at selected offset.
static int WriteULONG(byte[] buffer, long val, int off)
          Write ULONG at selected offset in given buffer.
 int WriteULONG(long val)
          Write ULONG at current offset, and advance offset
 int WriteULONG(long val, int off)
          Write ULONG at selected offset.
static int WriteULONGArray(byte[] buffer, long[] val, int off)
          Write ULONG array at selected offset in given buffer.
static int WriteULONGArray(byte[] buffer, long[] val, int start, int len, int off)
          Write long array at selected offset in given buffer.
 int WriteULONGArray(long[] val)
          Write ULONG array at current offset, and advance offset
 int WriteULONGArray(long[] val, int off)
          Write ULONG array at selected offset.
static int WriteULONGArrayLengthEncoded(byte[] buffer, long[] val, int off)
          Write ULONG array length encoded at selected offset in given buffer.
static int WriteULONGArrayLengthEncoded(byte[] buffer, long[] val, int start, int len, int off)
          Write ULONG array length encoded at selected offset in given buffer.
 int WriteULONGArrayLengthEncoded(long[] val)
          Write ULONG array length encoded at current offset, and advance.
 int WriteULONGArrayLengthEncoded(long[] val, int off)
          Write ULONG array length encoded at selected offset.
static int WriteUnicode(byte[] buffer, char val, int off)
          Write unicode char at selected offset in given buffer.
 int WriteUnicode(char val)
          Write unicode char at current offset, and advance offset
 int WriteUnicode(char val, int off)
          Write unicode char at selected offset.
static int WriteUnicodeArray(byte[] buffer, char[] val, int off)
          Write unicode array at selected offset in given buffer.
static int WriteUnicodeArray(byte[] buffer, char[] val, int start, int len, int off)
          Write char array at selected offset in given buffer.
 int WriteUnicodeArray(char[] val)
          Write unicode char array at current offset, and advance offset
 int WriteUnicodeArray(char[] val, int off)
          Write unicode char array at selected offset.
static int WriteUSHORT(byte[] buffer, int val, int off)
          Write USHORT at selected offset in given buffer.
 int WriteUSHORT(int val)
          Write USHORT at current offset, and advance offset
 int WriteUSHORT(int val, int off)
          Write USHORT at selected offset.
static int WriteUSHORTArray(byte[] buffer, int[] val, int off)
          Write USHORT array at selected offset in given buffer.
static int WriteUSHORTArray(byte[] buffer, int[] val, int start, int len, int off)
          Write int array at selected offset in given buffer.
 int WriteUSHORTArray(int[] val)
          Write USHORT array at current offset, and advance offset
 int WriteUSHORTArray(int[] val, int off)
          Write USHORT array at selected offset.
static int WriteUTF8(byte[] buf, java.lang.String s, int off)
          Write string to buffer in UTF-8 encoded format
 int WriteUTF8(java.lang.String s)
          Write string to buffer in UTF-8 encoded format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZEOF_LONG64

public static final int SIZEOF_LONG64
Size of various Intel data types

See Also:
Constant Field Values

SIZEOF_DOUBLE

public static final int SIZEOF_DOUBLE
See Also:
Constant Field Values

SIZEOF_FLOAT

public static final int SIZEOF_FLOAT
See Also:
Constant Field Values

SIZEOF_ULONG

public static final int SIZEOF_ULONG
See Also:
Constant Field Values

SIZEOF_LONG

public static final int SIZEOF_LONG
See Also:
Constant Field Values

SIZEOF_USHORT

public static final int SIZEOF_USHORT
See Also:
Constant Field Values

SIZEOF_UNICODE

public static final int SIZEOF_UNICODE
See Also:
Constant Field Values

SIZEOF_SHORT

public static final int SIZEOF_SHORT
See Also:
Constant Field Values

SIZEOF_UCHAR

public static final int SIZEOF_UCHAR
See Also:
Constant Field Values

SIZEOF_CHAR

public static final int SIZEOF_CHAR
See Also:
Constant Field Values
Constructor Detail

IntelByteBuffer

public IntelByteBuffer(byte[] inbuf)
Constructor for interpreting a provided byte array.

Parameters:
inbuf - input byte array to be interpreted

IntelByteBuffer

public IntelByteBuffer(byte[] inbuf,
                       int start_off)
Constructor for interpreting a provided byte array, with offsets relative to a provided offset.

Parameters:
inbuf - input byte array to be interpreted
start_off - offset in byte array of start of structure

IntelByteBuffer

public IntelByteBuffer(int buflen)
Constructor for building a new byte array with a given length.

Parameters:
buflen - Length of byte array to be created
Method Detail

SetOffset

public final void SetOffset(int off)
Set current offset index (relative to start)

Parameters:
off - new offset index

StepOffset

public final void StepOffset(int s)
Step current offset index (relative to start)

Parameters:
s - value to add to offset index

GetOffset

public final int GetOffset()
Get current offset index (relative to start)


SetStart

public final void SetStart(int s)
Set start index

Parameters:
s - new start index

StepStart

public final void StepStart(int s)
Step start index and reset offset

Parameters:
s - value to add to start index

ResetStart

public final void ResetStart(int s)
Reset start index and offset

Parameters:
s - value to reset start index to

GetStart

public final int GetStart()
Get start index


GetBuffer

public final byte[] GetBuffer()
Get byte buffer


SetBuffer

public final void SetBuffer(byte[] b)
Set byte buffer


ResizeBuffer

public final void ResizeBuffer(int newlen)
Resize byte buffer and preserve all remaining data.

Parameters:
newlen - - new length of buffer

ReadULONG

public static final long ReadULONG(byte[] buffer,
                                   int off)
Read ULONG from selected offset in byte array.

Parameters:
buffer - - byte array to be read
off - - offset within buffer to read from
Returns:
value read, as 'long'

ReadULONG

public final long ReadULONG(int off)
Read ULONG from selected offset.

Parameters:
off - - offset relative to buffer start
Returns:
value read, as 'long'

ReadULONG

public final long ReadULONG()
Read ULONG from current offset, and advance offset

Returns:
value read, as 'long'

WriteULONG

public static final int WriteULONG(byte[] buffer,
                                   long val,
                                   int off)
Write ULONG at selected offset in given buffer.

Parameters:
buffer - - buffer to be written to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteULONG

public final int WriteULONG(long val,
                            int off)
Write ULONG at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteULONG

public final int WriteULONG(long val)
Write ULONG at current offset, and advance offset

Parameters:
val - value to be written

ReadUSHORT

public static final int ReadUSHORT(byte[] buffer,
                                   int off)
Read USHORT from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start

ReadUSHORT

public final int ReadUSHORT(int off)
Read USHORT from selected offset.

Parameters:
off - offset relative to buffer start

ReadUSHORT

public final int ReadUSHORT()
Read USHORT from current offset, and advance offset


WriteUSHORT

public static final int WriteUSHORT(byte[] buffer,
                                    int val,
                                    int off)
Write USHORT at selected offset in given buffer.

Parameters:
buffer - - buffer to be written to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteUSHORT

public final int WriteUSHORT(int val,
                             int off)
Write USHORT at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteUSHORT

public final int WriteUSHORT(int val)
Write USHORT at current offset, and advance offset

Parameters:
val - value to be written

ReadUnicode

public static final char ReadUnicode(byte[] buffer,
                                     int off)
Read unicode char from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start

ReadUnicode

public final char ReadUnicode(int off)
Read unicode char from selected offset.

Parameters:
off - offset relative to buffer start

ReadUnicode

public final int ReadUnicode()
Read unicode char from current offset, and advance offset


WriteUnicode

public static final int WriteUnicode(byte[] buffer,
                                     char val,
                                     int off)
Write unicode char at selected offset in given buffer.

Parameters:
buffer - - buffer to be written to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteUnicode

public final int WriteUnicode(char val,
                              int off)
Write unicode char at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteUnicode

public final int WriteUnicode(char val)
Write unicode char at current offset, and advance offset

Parameters:
val - value to be written

ReadUCHAR

public static final short ReadUCHAR(byte[] buffer,
                                    int off)
Read UCHAR from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start

ReadUCHAR

public final short ReadUCHAR(int off)
Read UCHAR from selected offset.

Parameters:
off - offset relative to buffer start

ReadUCHAR

public final short ReadUCHAR()
Read UCHAR from current offset, and advance offset


WriteUCHAR

public static final int WriteUCHAR(byte[] buffer,
                                   int val,
                                   int off)
Write UCHAR at selected offset in given buffer.

Parameters:
buffer - - array to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteUCHAR

public final int WriteUCHAR(int val,
                            int off)
Write UCHAR at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteUCHAR

public final int WriteUCHAR(int val)
Write UCHAR at current offset, and advance offset

Parameters:
val - value to be written

ReadLONG

public static final int ReadLONG(byte[] buffer,
                                 int off)
Read LONG from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start

ReadLONG

public final int ReadLONG(int off)
Read LONG from selected offset.

Parameters:
off - offset relative to buffer start

ReadLONG

public final int ReadLONG()
Read LONG from current offset, and advance offset


WriteLONG

public static final int WriteLONG(byte[] buffer,
                                  int val,
                                  int off)
Write LONG at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteLONG

public final int WriteLONG(int val,
                           int off)
Write LONG at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteLONG

public final int WriteLONG(int val)
Write LONG at current offset, and advance offset

Parameters:
val - value to be written

ReadFloat

public static final float ReadFloat(byte[] buffer,
                                    int off)
Read float from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start

ReadFloat

public final float ReadFloat(int off)
Read float from selected offset.

Parameters:
off - offset relative to buffer start

ReadFloat

public final float ReadFloat()
Read float from current offset, and advance offset


WriteFloat

public static final int WriteFloat(byte[] buffer,
                                   float val,
                                   int off)
Write float at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteFloat

public final int WriteFloat(float val,
                            int off)
Write float at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteFloat

public final float WriteFloat(float val)
Write float at current offset, and advance offset

Parameters:
val - value to be written

ReadLong64

public static final long ReadLong64(byte[] buffer,
                                    int off)
Read 64-bit long from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
Returns:
64-bit value read as long

ReadLong64

public final long ReadLong64(int off)
Read 64-bit long from selected offset.

Parameters:
off - offset relative to buffer start
Returns:
64-bit value read as long

ReadLong64

public final long ReadLong64()
Read 64-bit long from current offset, and advance offset

Returns:
64-bit value read as long

WriteLong64

public static final int WriteLong64(byte[] buffer,
                                    long val,
                                    int off)
Write 64-bit long at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteLong64

public final int WriteLong64(long val,
                             int off)
Write 64-bit long at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start
Returns:
offset past end of value written

WriteLong64

public final int WriteLong64(long val)
Write 64-bit long at current offset, and advance offset

Parameters:
val - value to be written
Returns:
new offset value

ReadDouble

public static final double ReadDouble(byte[] buffer,
                                      int off)
Read double from selected offset from given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
Returns:
value read as double

ReadDouble

public final double ReadDouble(int off)
Read double from selected offset.

Parameters:
off - offset relative to buffer start
Returns:
value read as double

ReadDouble

public final double ReadDouble()
Read double from current offset, and advance offset


WriteDouble

public static final int WriteDouble(byte[] buffer,
                                    double val,
                                    int off)
Write double at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteDouble

public final int WriteDouble(double val,
                             int off)
Write double at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteDouble

public final int WriteDouble(double val)
Write double at current offset, and advance offset

Parameters:
val - value to be written

ReadSHORT

public static final short ReadSHORT(byte[] buffer,
                                    int off)
Read SHORT from selected offset from given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start

ReadSHORT

public final short ReadSHORT(int off)
Read SHORT from selected offset.

Parameters:
off - offset relative to buffer start

ReadSHORT

public final short ReadSHORT()
Read SHORT from current offset, and advance offset


WriteSHORT

public static final int WriteSHORT(byte[] buffer,
                                   int val,
                                   int off)
Write SHORT at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteSHORT

public final int WriteSHORT(int val,
                            int off)
Write SHORT at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteSHORT

public final int WriteSHORT(int val)
Write SHORT at current offset, and advance offset

Parameters:
val - value to be written

ReadCHAR

public static final byte ReadCHAR(byte[] buffer,
                                  int off)
Read CHAR from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start

ReadCHAR

public final byte ReadCHAR(int off)
Read CHAR from selected offset.

Parameters:
off - offset relative to buffer start

ReadCHAR

public final byte ReadCHAR()
Read CHAR from current offset, and advance offset


WriteCHAR

public static final int WriteCHAR(byte[] buffer,
                                  int val,
                                  int off)
Write CHAR at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteCHAR

public final int WriteCHAR(int val,
                           int off)
Write CHAR at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteCHAR

public final int WriteCHAR(int val)
Write CHAR at current offset, and advance offset

Parameters:
val - value to be written

ReadASCIIZ

public static final java.lang.String ReadASCIIZ(byte[] buffer,
                                                int off)
Read ASCIIZ string at selected offset in given buffer, return as String. ASCIIZ strings are limited to character codes 0000-007f A zero length string "" is returned when the ASCIIZ string read was zero length (contained only 0x00).

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start

ReadASCIIZ

public final java.lang.String ReadASCIIZ(int off)
Read ASCIIZ string at selected offset, return as String. ASCIIZ strings are limited to character codes 0000-007f A zero length string "" is returned when the ASCIIZ string read was zero length (contained only 0x00).

Parameters:
off - offset relative to buffer start

ReadASCIIZ

public final java.lang.String ReadASCIIZ()
Read ASCIIZ string at current offset, advance, return as String. ASCIIZ strings are limited to character codes 0000-007f A zero length string "" is returned when the ASCIIZ string read was zero length (contained only 0x00).


SkipASCIIZ

public static final int SkipASCIIZ(byte[] buffer,
                                   int off)
Skip over ASCIIZ string at given offset in given buffer ASCIIZ strings are limited to character codes 0000-007f

Parameters:
buffer - - buffer to be read from
off - - offset for start of read
Returns:
offset past end of string skipped

SkipASCIIZ

public final void SkipASCIIZ()
Skip over ASCIIZ string at current offset, just advance offset. ASCIIZ strings are limited to character codes 0000-007f


WriteASCIIZ

public static final int WriteASCIIZ(byte[] buffer,
                                    java.lang.String val,
                                    int off)
Write string as ASCIIZ at selected offset in given buffer. ASCIIZ strings are limited to character codes 0000-007f

Parameters:
buffer - - buffer to write to
val - - String value to be written
off - - offset relative to buffer start
Returns:
offset past end of string written

WriteASCIIZ

public final int WriteASCIIZ(java.lang.String val,
                             int off)
Write string as ASCIIZ at selected offset. ASCIIZ strings are limited to character codes 0000-007f

Parameters:
val - String value to be written
off - offset relative to buffer start

WriteASCIIZ

public final int WriteASCIIZ(java.lang.String val)
Write string as ASCIIZ at current offset, and advance offset ASCIIZ strings are limited to character codes 0000-007f

Parameters:
val - String value to be written

GetASCIIZLength

public static final int GetASCIIZLength(java.lang.String val)
Get length of ASCIIZ version of string, in bytes ASCIIZ strings are limited to character codes 0000-007f

Parameters:
val - String value to be checked

ReadCompUnicode

public static final java.lang.String ReadCompUnicode(byte[] buffer,
                                                     int off)
Read compressed unicode string at selected offset in given buffer, return as String.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
Returns:
String representation of value read

ReadCompUnicode

public final java.lang.String ReadCompUnicode(int off)
Read compressed unicode string at selected offset, return as String.

Parameters:
off - offset relative to buffer start

ReadCompUnicode

public final java.lang.String ReadCompUnicode()
Read compressed unicode string at current offset, advance, return as String.


SkipCompUnicode

public static final int SkipCompUnicode(byte[] buffer,
                                        int off)
Skip over compressed unicode string at given offset in given buffer,

Parameters:
buffer - - buffer to read from
off - - offset to start skipping from
Returns:
offset past end of string skipped

SkipCompUnicode

public final void SkipCompUnicode()
Skip over compressed unicode string at current offset, just advance offset.


WriteCompUnicode

public static final int WriteCompUnicode(byte[] buffer,
                                         java.lang.String val,
                                         int off)
Write string as compressed unicode at selected offset in given buffer.

Parameters:
buffer - - buffer to write into
val - - String value to be written
off - - offset relative to buffer start
Returns:
offset past end of string written

WriteCompUnicode

public final int WriteCompUnicode(java.lang.String val,
                                  int off)
Write string as compressed unicode at selected offset.

Parameters:
val - String value to be written
off - offset relative to buffer start
Returns:
offset past end of string written

WriteCompUnicode

public final int WriteCompUnicode(java.lang.String val)
Write string as compressed unicode at current offset, and advance offset

Parameters:
val - String value to be written

GetCompUnicodeLength

public static final int GetCompUnicodeLength(java.lang.String val)
Get length of compressed unicode version of string, in bytes

Parameters:
val - String value to be checked

ReadCHARArray

public static final byte[] ReadCHARArray(byte[] buffer,
                                         int off,
                                         int len)
Read byte array from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
len - - length of byte array to read
Returns:
byte array containing data requested

ReadCHARArray

public final byte[] ReadCHARArray(int off,
                                  int len)
Read byte array from selected offset.

Parameters:
off - offset relative to buffer start
len - length of byte array to read

ReadCHARArray

public final byte[] ReadCHARArray(int len)
Read byte array from current offset, and advance offset

Parameters:
len - length of byte array to read

WriteCHARArray

public static final int WriteCHARArray(byte[] buffer,
                                       byte[] val,
                                       int off)
Write byte array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - value to be written
off - offset relative to buffer start
Returns:
new offset

WriteCHARArray

public static final int WriteCHARArray(byte[] buffer,
                                       byte[] val,
                                       int start,
                                       int len,
                                       int off)
Write byte array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteCHARArray

public final int WriteCHARArray(byte[] val,
                                int off)
Write byte array at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteCHARArray

public final int WriteCHARArray(byte[] val)
Write byte array at current offset, and advance offset

Parameters:
val - value to be written

WriteCHARArray

public final int WriteCHARArray(byte[] val,
                                int source_off,
                                int len)
Write byte array of specified length at current offset and advance offset

Parameters:
val - buffer containing source value
len - length to copy from val buffer

ReadUCHARArray

public static final int[] ReadUCHARArray(byte[] buffer,
                                         int off,
                                         int len)
Read UCHAR array from selected offset of given buffer

Parameters:
buffer - - buffer to read from
off - offset relative to buffer start
len - length of UCHAR array to read
Returns:
array of values read

ReadUCHARArray

public final int[] ReadUCHARArray(int off,
                                  int len)
Read UCHAR array from selected offset.

Parameters:
off - offset relative to buffer start
len - length of UCHAR array to read

ReadUCHARArray

public final int[] ReadUCHARArray(int len)
Read UCHAR array from current offset, and advance offset

Parameters:
len - length of byte array to read

WriteUCHARArray

public static final int WriteUCHARArray(byte[] buffer,
                                        int[] val,
                                        int off)
Write UCHAR array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteUCHARArray

public static final int WriteUCHARArray(byte[] buffer,
                                        int[] val,
                                        int start,
                                        int len,
                                        int off)
Write byte array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteUCHARArray

public final int WriteUCHARArray(int[] val,
                                 int off)
Write UCHAR array at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteUCHARArray

public final int WriteUCHARArray(int[] val)
Write UCHAR array at current offset, and advance offset

Parameters:
val - value to be written

ReadUSHORTArray

public static final int[] ReadUSHORTArray(byte[] buffer,
                                          int off,
                                          int len)
Read USHORT array from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
len - - length of USHORT array to read
Returns:
array containing values read

ReadUSHORTArray

public final int[] ReadUSHORTArray(int off,
                                   int len)
Read USHORT array from selected offset.

Parameters:
off - offset relative to buffer start
len - length of USHORT array to read
Returns:
array containing values read

ReadUSHORTArray

public final int[] ReadUSHORTArray(int len)
Read USHORT array from current offset, and advance offset

Parameters:
len - length of USHORT array to read
Returns:
array containing values read

WriteUSHORTArray

public static final int WriteUSHORTArray(byte[] buffer,
                                         int[] val,
                                         int off)
Write USHORT array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteUSHORTArray

public static final int WriteUSHORTArray(byte[] buffer,
                                         int[] val,
                                         int start,
                                         int len,
                                         int off)
Write int array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteUSHORTArray

public final int WriteUSHORTArray(int[] val,
                                  int off)
Write USHORT array at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteUSHORTArray

public final int WriteUSHORTArray(int[] val)
Write USHORT array at current offset, and advance offset

Parameters:
val - value to be written

ReadUnicodeArray

public static final char[] ReadUnicodeArray(byte[] buffer,
                                            int off,
                                            int len)
Read unicode char array from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
len - - length of unicode array to read
Returns:
array containing values read

ReadUnicodeArray

public final char[] ReadUnicodeArray(int off,
                                     int len)
Read unicode char array from selected offset.

Parameters:
off - offset relative to buffer start
len - length of unicode array to read
Returns:
array containing values read

ReadUnicodeArray

public final char[] ReadUnicodeArray(int len)
Read unicode char array from current offset, and advance offset

Parameters:
len - length of unicode array to read
Returns:
array containing values read

WriteUnicodeArray

public static final int WriteUnicodeArray(byte[] buffer,
                                          char[] val,
                                          int off)
Write unicode array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteUnicodeArray

public static final int WriteUnicodeArray(byte[] buffer,
                                          char[] val,
                                          int start,
                                          int len,
                                          int off)
Write char array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteUnicodeArray

public final int WriteUnicodeArray(char[] val,
                                   int off)
Write unicode char array at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteUnicodeArray

public final int WriteUnicodeArray(char[] val)
Write unicode char array at current offset, and advance offset

Parameters:
val - value to be written

ReadSHORTArray

public static final short[] ReadSHORTArray(byte[] buffer,
                                           int off,
                                           int len)
Read SHORT array from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
len - - length of SHORT array to read
Returns:
array of values read

ReadSHORTArray

public final short[] ReadSHORTArray(int off,
                                    int len)
Read SHORT array from selected offset.

Parameters:
off - offset relative to buffer start
len - length of SHORT array to read
Returns:
array of values read

ReadSHORTArray

public final short[] ReadSHORTArray(int len)
Read SHORT array from current offset, and advance offset

Parameters:
len - length of SHORT array to read
Returns:
array of values read

WriteSHORTArray

public static final int WriteSHORTArray(byte[] buffer,
                                        short[] val,
                                        int off)
Write SHORT array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteSHORTArray

public static final int WriteSHORTArray(byte[] buffer,
                                        short[] val,
                                        int start,
                                        int len,
                                        int off)
Write short array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteSHORTArray

public final int WriteSHORTArray(short[] val,
                                 int off)
Write SHORT array at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteSHORTArray

public final int WriteSHORTArray(short[] val)
Write SHORT at current offset, and advance offset

Parameters:
val - value to be written

ReadULONGArray

public static final long[] ReadULONGArray(byte[] buffer,
                                          int off,
                                          int len)
Read ULONG array from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
len - - length of ULONG array to read
Returns:
array of values read

ReadULONGArray

public final long[] ReadULONGArray(int off,
                                   int len)
Read ULONG array from selected offset.

Parameters:
off - offset relative to buffer start
len - length of ULONG array to read
Returns:
array of values read

ReadULONGArray

public final long[] ReadULONGArray(int len)
Read ULONG array from current offset, and advance offset

Parameters:
len - length of ULONG array to read
Returns:
array of values read

WriteULONGArray

public static final int WriteULONGArray(byte[] buffer,
                                        long[] val,
                                        int off)
Write ULONG array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteULONGArray

public static final int WriteULONGArray(byte[] buffer,
                                        long[] val,
                                        int start,
                                        int len,
                                        int off)
Write long array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteULONGArray

public final int WriteULONGArray(long[] val,
                                 int off)
Write ULONG array at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteULONGArray

public final int WriteULONGArray(long[] val)
Write ULONG array at current offset, and advance offset

Parameters:
val - value to be written

ReadLONGArray

public static final int[] ReadLONGArray(byte[] buffer,
                                        int off,
                                        int len)
Read LONG array from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
len - - length of LONG array
Returns:
array of values read

ReadLONGArray

public final int[] ReadLONGArray(int off,
                                 int len)
Read LONG array from selected offset.

Parameters:
off - offset relative to buffer start
len - length of LONG array

ReadLONGArray

public final int[] ReadLONGArray(int len)
Read LONG array from current offset, and advance offset

Parameters:
len - length of LONG array

WriteLONGArray

public static final int WriteLONGArray(byte[] buffer,
                                       int[] val,
                                       int off)
Write LONG array at selected offset in given array.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteLONGArray

public static final int WriteLONGArray(byte[] buffer,
                                       int[] val,
                                       int start,
                                       int len,
                                       int off)
Write LONG array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteLONGArray

public final int WriteLONGArray(int[] val,
                                int off)
Write LONG array at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteLONGArray

public final int WriteLONGArray(int[] val)
Write LONG array at current offset, and advance offset

Parameters:
val - value to be written

ReadLong64Array

public static final long[] ReadLong64Array(byte[] buffer,
                                           int off,
                                           int len)
Read 64-bit long array from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
len - - length of 64-bit long array
Returns:
array of values read

ReadLong64Array

public final long[] ReadLong64Array(int off,
                                    int len)
Read 64-bit long array from selected offset.

Parameters:
off - offset relative to buffer start
len - length of 64-bit long array
Returns:
array of values read

ReadLong64Array

public final long[] ReadLong64Array(int len)
Read 64-bit long array from current offset, and advance offset

Parameters:
len - length of 64-bit long array

WriteLong64Array

public static final int WriteLong64Array(byte[] buffer,
                                         long[] val,
                                         int off)
Write 64-bit long array at selected offset in given array.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteLong64Array

public static final int WriteLong64Array(byte[] buffer,
                                         long[] val,
                                         int start,
                                         int len,
                                         int off)
Write LONG array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteLong64Array

public final int WriteLong64Array(long[] val,
                                  int off)
Write 64-bit long array at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteLong64Array

public final int WriteLong64Array(long[] val)
Write 64-bit long array at current offset, and advance offset

Parameters:
val - value to be written

ReadFloatArray

public static final float[] ReadFloatArray(byte[] buffer,
                                           int off,
                                           int len)
Read float array from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
len - - length of float array
Returns:
array of values read

ReadFloatArray

public final float[] ReadFloatArray(int off,
                                    int len)
Read float from selected offset.

Parameters:
off - offset relative to buffer start
len - length of float array

ReadFloatArray

public final float[] ReadFloatArray(int len)
Read float array from current offset, and advance offset

Parameters:
len - length of float array

WriteFloatArray

public static final int WriteFloatArray(byte[] buffer,
                                        float[] val,
                                        int off)
Write float array at selected offset in given array.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteFloatArray

public static final int WriteFloatArray(byte[] buffer,
                                        float[] val,
                                        int start,
                                        int len,
                                        int off)
Write float array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteFloatArray

public final int WriteFloatArray(float[] val,
                                 int off)
Write float array at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteFloatArray

public final int WriteFloatArray(float[] val)
Write float array at current offset, and advance offset

Parameters:
val - value to be written

ReadDoubleArray

public static final double[] ReadDoubleArray(byte[] buffer,
                                             int off,
                                             int len)
Read double array from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
len - - length of double array
Returns:
array of values read

ReadDoubleArray

public final double[] ReadDoubleArray(int off,
                                      int len)
Read double array from selected offset.

Parameters:
off - offset relative to buffer start
len - length of double array
Returns:
array of values read

ReadDoubleArray

public final double[] ReadDoubleArray(int len)
Read double array from current offset, and advance offset

Parameters:
len - length of double array

WriteDoubleArray

public static final int WriteDoubleArray(byte[] buffer,
                                         double[] val,
                                         int off)
Write double array at selected offset in given array.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteDoubleArray

public static final int WriteDoubleArray(byte[] buffer,
                                         double[] val,
                                         int start,
                                         int len,
                                         int off)
Write double array at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteDoubleArray

public final int WriteDoubleArray(double[] val,
                                  int off)
Write double array at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteDoubleArray

public final int WriteDoubleArray(double[] val)
Write double long array at current offset, and advance offset

Parameters:
val - value to be written

ReadULONGLengthEncodedArray

public static final long[] ReadULONGLengthEncodedArray(byte[] buffer,
                                                       int off,
                                                       int len)
Read ULONG array in length-encoded format from selected offset in given buffer. Length encoded format is 7 databits + high bit set for value continuation.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
len - - length of ULONG array to read
Returns:
array of values read

ReadULONGLengthEncodedArray

public final long[] ReadULONGLengthEncodedArray(int off,
                                                int len)
Read ULONG array in length-encoded format from selected offset. Length encoded format is 7 databits + high bit set for value continuation.

Parameters:
off - offset relative to buffer start
len - length of ULONG array to read
Returns:
array of values read

ReadULONGLengthEncodedArray

public final long[] ReadULONGLengthEncodedArray(int len)
Read ULONG array in length-encoded format, and advance offset. Length encoded format is 7 databits + high bit set for value continuation.

Parameters:
len - length of ULONG array to read
Returns:
array of values read

WriteULONGArrayLengthEncoded

public static final int WriteULONGArrayLengthEncoded(byte[] buffer,
                                                     long[] val,
                                                     int off)
Write ULONG array length encoded at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteULONGArrayLengthEncoded

public static final int WriteULONGArrayLengthEncoded(byte[] buffer,
                                                     long[] val,
                                                     int start,
                                                     int len,
                                                     int off)
Write ULONG array length encoded at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteULONGArrayLengthEncoded

public final int WriteULONGArrayLengthEncoded(long[] val,
                                              int off)
Write ULONG array length encoded at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteULONGArrayLengthEncoded

public final int WriteULONGArrayLengthEncoded(long[] val)
Write ULONG array length encoded at current offset, and advance.

Parameters:
val - value to be written

SkipLengthEncodedULONGArray

public static final int SkipLengthEncodedULONGArray(byte[] buffer,
                                                    int off,
                                                    int len)
Skip over length encoded ULONG array at given offset in given buffer,

Parameters:
buffer - - buffer to read from
off - - offset to start skipping from
len - - number of elements in length encoded array
Returns:
offset past end of string skipped

SkipLengthEncodedULONGArray

public final void SkipLengthEncodedULONGArray(int len)
Skip over length encoded ULONG array at current offset, just advance offset.

Parameters:
len - - number of elements in length encoded array

GetLengthEncodedULONGArrayLength

public static final int GetLengthEncodedULONGArrayLength(long[] val,
                                                         int start,
                                                         int len)
Get length needed for length encodeding given array as ULONGs

Parameters:
val - - array of values
start - - starting index in values array
len - - length of range in values array
Returns:
length in bytes needed

ReadLONGLengthEncodedArray

public static final int[] ReadLONGLengthEncodedArray(byte[] buffer,
                                                     int off,
                                                     int len)
Read LONG array in length-encoded format from selected offset in given buffer. Length encoded format is 7 databits + high bit set for value continuation (except for the first byte, which is 6 databits + sign bit + high bit for continuation)

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
len - - length of LONG array to read
Returns:
array of values read

ReadLONGLengthEncodedArray

public final int[] ReadLONGLengthEncodedArray(int off,
                                              int len)
Read LONG array in length-encoded format from selected offset. Length encoded format is 7 databits + high bit set for value continuation.

Parameters:
off - offset relative to buffer start
len - length of LONG array to read
Returns:
array of values read

ReadLONGLengthEncodedArray

public final int[] ReadLONGLengthEncodedArray(int len)
Read LONG array in length-encoded format, and advance offset. Length encoded format is 7 databits + high bit set for value continuation.

Parameters:
len - length of LONG array to read
Returns:
array of values read

WriteLONGArrayLengthEncoded

public static final int WriteLONGArrayLengthEncoded(byte[] buffer,
                                                    int[] val,
                                                    int off)
Write LONG array length encoded at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteLONGArrayLengthEncoded

public static final int WriteLONGArrayLengthEncoded(byte[] buffer,
                                                    int[] val,
                                                    int start,
                                                    int len,
                                                    int off)
Write LONG array length encoded at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteLONGArrayLengthEncoded

public final int WriteLONGArrayLengthEncoded(int[] val,
                                             int off)
Write LONG array length encoded at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteLONGArrayLengthEncoded

public final int WriteLONGArrayLengthEncoded(int[] val)
Write LONG array length encoded at current offset, and advance.

Parameters:
val - value to be written

SkipLengthEncodedLONGArray

public static final int SkipLengthEncodedLONGArray(byte[] buffer,
                                                   int off,
                                                   int len)
Skip over length encoded LONG array at given offset in given buffer,

Parameters:
buffer - - buffer to read from
off - - offset to start skipping from
len - - number of elements in length encoded array
Returns:
offset past end of string skipped

SkipLengthEncodedLONGArray

public final void SkipLengthEncodedLONGArray(int len)
Skip over length encoded LONG array at current offset, just advance offset.

Parameters:
len - - number of elements in length encoded array

GetLengthEncodedLONGArrayLength

public static final int GetLengthEncodedLONGArrayLength(int[] val,
                                                        int start,
                                                        int len)
Get length needed for length encodeding given array as LONGs

Parameters:
val - - array of values
start - - starting index in values array
len - - length of range in values array
Returns:
length in bytes needed

ReadLong64LengthEncodedArray

public static final long[] ReadLong64LengthEncodedArray(byte[] buffer,
                                                        int off,
                                                        int len)
Read Long64 array in length-encoded format from selected offset in given buffer. Length encoded format is 7 databits + high bit set for value continuation (except for the first byte, which is 6 databits + sign bit + high bit for continuation)

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
len - - length of Long64 array to read
Returns:
array of values read

ReadLong64LengthEncodedArray

public final long[] ReadLong64LengthEncodedArray(int off,
                                                 int len)
Read Long64 array in length-encoded format from selected offset. Length encoded format is 7 databits + high bit set for value continuation.

Parameters:
off - offset relative to buffer start
len - length of Long64 array to read
Returns:
array of values read

ReadLong64LengthEncodedArray

public final long[] ReadLong64LengthEncodedArray(int len)
Read Long64 array in length-encoded format, and advance offset. Length encoded format is 7 databits + high bit set for value continuation.

Parameters:
len - length of LONG array to read
Returns:
array of values read

WriteLong64ArrayLengthEncoded

public static final int WriteLong64ArrayLengthEncoded(byte[] buffer,
                                                      long[] val,
                                                      int off)
Write Long64 array length encoded at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - - value to be written
off - - offset relative to buffer start
Returns:
new offset

WriteLong64ArrayLengthEncoded

public static final int WriteLong64ArrayLengthEncoded(byte[] buffer,
                                                      long[] val,
                                                      int start,
                                                      int len,
                                                      int off)
Write Long64 array length encoded at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
val - array containing values to be written
start - index in val of start of data
off - offset relative to buffer start
Returns:
new offset

WriteLong64ArrayLengthEncoded

public final int WriteLong64ArrayLengthEncoded(long[] val,
                                               int off)
Write Long64 array length encoded at selected offset.

Parameters:
val - value to be written
off - offset relative to buffer start

WriteLong64ArrayLengthEncoded

public final int WriteLong64ArrayLengthEncoded(long[] val)
Write Long64 array length encoded at current offset, and advance.

Parameters:
val - value to be written

SkipLengthEncodedLong64Array

public static final int SkipLengthEncodedLong64Array(byte[] buffer,
                                                     int off,
                                                     int len)
Skip over length encoded Long64 array at given offset in given buffer,

Parameters:
buffer - - buffer to read from
off - - offset to start skipping from
len - - number of elements in length encoded array
Returns:
offset past end of string skipped

SkipLengthEncodedLong64Array

public final void SkipLengthEncodedLong64Array(int len)
Skip over length encoded Long64 array at current offset, just advance offset.

Parameters:
len - - number of elements in length encoded array

GetLengthEncodedLong64ArrayLength

public static final int GetLengthEncodedLong64ArrayLength(long[] val,
                                                          int start,
                                                          int len)
Get length needed for length encodeding given array as Long64s

Parameters:
val - - array of values
start - - starting index in values array
len - - length of range in values array
Returns:
length in bytes needed

ReadLongValueSet

public static final LongValueSet ReadLongValueSet(byte[] buffer,
                                                  int off)
Read LongValueSet from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
Returns:
LongValueSet to be read

ReadLongValueSet

public final LongValueSet ReadLongValueSet(int off)
Read LongValueSet from selected offset.

Parameters:
off - offset relative to buffer start
Returns:
LongValueSet read

ReadLongValueSet

public final LongValueSet ReadLongValueSet()
Read LongValueSet, and advance offset.

Returns:
LongValueSet read

WriteLongValueSet

public static final int WriteLongValueSet(byte[] buffer,
                                          LongValueSet valset,
                                          int off)
Write LongValueSet at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
off - - offset relative to buffer start
Returns:
new offset

WriteLongValueSet

public final int WriteLongValueSet(LongValueSet val,
                                   int off)
Write LongValueSet at selected offset.

Parameters:
val - - LongValueSet to be written
off - - offset relative to buffer start

WriteLongValueSet

public final int WriteLongValueSet(LongValueSet val)
Write LongValueSet at current offset, and advance.

Parameters:
val - - LongValueSet to be written

SkipLongValueSet

public static final int SkipLongValueSet(byte[] buffer,
                                         int off)
Skip over LongValueSet at given offset in given buffer,

Parameters:
buffer - - buffer to read from
off - - offset to start skipping from
Returns:
offset past end of string skipped

SkipLongValueSet

public final void SkipLongValueSet()
Skip over LongValueSet at current offset, just advance offset.


GetLongValueSetLength

public static final int GetLongValueSetLength(LongValueSet valset)
Get length needed for LongValueSet

Returns:
length in bytes needed

ReadIntValueSet

public static final IntValueSet ReadIntValueSet(byte[] buffer,
                                                int off)
Read IntValueSet from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
Returns:
IntValueSet to be read

ReadIntValueSet

public final IntValueSet ReadIntValueSet(int off)
Read IntValueSet from selected offset.

Parameters:
off - offset relative to buffer start
Returns:
IntValueSet read

ReadIntValueSet

public final IntValueSet ReadIntValueSet()
Read IntValueSet, and advance offset.

Returns:
IntValueSet read

WriteIntValueSet

public static final int WriteIntValueSet(byte[] buffer,
                                         IntValueSet valset,
                                         int off)
Write IntValueSet at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
off - - offset relative to buffer start
Returns:
new offset

WriteIntValueSet

public final int WriteIntValueSet(IntValueSet val,
                                  int off)
Write IntValueSet at selected offset.

Parameters:
val - - IntValueSet to be written
off - - offset relative to buffer start

WriteIntValueSet

public final int WriteIntValueSet(IntValueSet val)
Write IntValueSet at current offset, and advance.

Parameters:
val - - IntValueSet to be written

SkipIntValueSet

public static final int SkipIntValueSet(byte[] buffer,
                                        int off)
Skip over IntValueSet at given offset in given buffer,

Parameters:
buffer - - buffer to read from
off - - offset to start skipping from
Returns:
offset past end of string skipped

SkipIntValueSet

public final void SkipIntValueSet()
Skip over IntValueSet at current offset, just advance offset.


GetIntValueSetLength

public static final int GetIntValueSetLength(IntValueSet valset)
Get length needed for IntValueSet

Returns:
length in bytes needed

ReadStringValueSet

public static final StringValueSet ReadStringValueSet(byte[] buffer,
                                                      int off)
Read StringValueSet from selected offset in given buffer.

Parameters:
buffer - - buffer to read from
off - - offset relative to buffer start
Returns:
StringValueSet to be read

ReadStringValueSet

public final StringValueSet ReadStringValueSet(int off)
Read StringValueSet from selected offset.

Parameters:
off - offset relative to buffer start
Returns:
StringValueSet read

ReadStringValueSet

public final StringValueSet ReadStringValueSet()
Read StringValueSet, and advance offset.

Returns:
StringValueSet read

WriteStringValueSet

public static final int WriteStringValueSet(byte[] buffer,
                                            StringValueSet valset,
                                            int off)
Write StringValueSet at selected offset in given buffer.

Parameters:
buffer - - buffer to write to
off - - offset relative to buffer start
Returns:
new offset

WriteStringValueSet

public final int WriteStringValueSet(StringValueSet val,
                                     int off)
Write StringValueSet at selected offset.

Parameters:
val - - StringValueSet to be written
off - - offset relative to buffer start

WriteStringValueSet

public final int WriteStringValueSet(StringValueSet val)
Write StringValueSet at current offset, and advance.

Parameters:
val - - StringValueSet to be written

SkipStringValueSet

public static final int SkipStringValueSet(byte[] buffer,
                                           int off)
Skip over StringValueSet at given offset in given buffer,

Parameters:
buffer - - buffer to read from
off - - offset to start skipping from
Returns:
offset past end of string skipped

SkipStringValueSet

public final void SkipStringValueSet()
Skip over StringValueSet at current offset, just advance offset.


GetStringValueSetLength

public static final int GetStringValueSetLength(StringValueSet valset)
Get length needed for StringValueSet

Returns:
length in bytes needed

GetUTF8

public static final byte[] GetUTF8(java.lang.String s)
Get UTF-8 encoding of string

Parameters:
s - - string to be encoded
Returns:
byte array containing encoded string

WriteUTF8

public static final int WriteUTF8(byte[] buf,
                                  java.lang.String s,
                                  int off)
Write string to buffer in UTF-8 encoded format

Parameters:
buf - - buffer
s - - string to be written
off - - offset to write within buffer
Returns:
offset of byte past end of encoded string

WriteUTF8

public final int WriteUTF8(java.lang.String s)
Write string to buffer in UTF-8 encoded format

Parameters:
s - - string to be written
Returns:
offset of byte past end of encoded string

GetUTF8Length

public static final int GetUTF8Length(java.lang.String s)
Get length needed to encode string in UTF-8

Parameters:
s - - string to be encoded
Returns:
length needed, in bytes, including terminating '\0'

ReadUTF8

public static final java.lang.String ReadUTF8(byte[] buf,
                                              int off)
Read UTF-8 encoded string from given buffer

Parameters:
buf - - buffer to be read
off - - offset to start reading
Returns:
string read, or null if not valid UTF-8 string

ReadUTF8

public final java.lang.String ReadUTF8()
Read UTF-8 encoded string at current offset, advance, return as String.


SkipUTF8

public final void SkipUTF8()
Skip over UTF-8 encoded string at current offset, just advance offset.


SkipUTF8

public static final int SkipUTF8(byte[] buf,
                                 int off)
Skip over UTF-8 encoded string at given offset in given buffer

Parameters:
off - - offset to start skipping from
Returns:
offset past end of string skipped

GetEncodedUTF8Length

public static final int GetEncodedUTF8Length(byte[] buf,
                                             int off)
Test for valid UTF-8 encoded string, and return length

Parameters:
buf - - buffer to be read
off - - offset of encoded string
Returns:
length of UTF-8 string (in chars) (no null), or -1 if invalid

BytesToString

public static java.lang.String BytesToString(byte[] buffer,
                                             int start,
                                             int len)
Convert range of bytes in a byte array to a string of hexadecimal digits.

Parameters:
buffer - - buffer containing bytes
start - - offset of first byte to convert
len - - number of bytes to be converted
Returns:
string containing hexadecimal digits

BytesToString

public static java.lang.String BytesToString(byte[] buffer)
Convert bytes in a byte array to a string of hexadecimal digits.

Parameters:
buffer - - buffer containing bytes
Returns:
string containing hexadecimal digits

printBytes

public static void printBytes(byte[] buf,
                              int begin,
                              int len)
Print bytes to System.out (for debug)

Parameters:
buf - - buffer to be printed
begin - - index to start
len - - length to print

printBytes

public static void printBytes(byte[] buf)
Print bytes to System.out (for debug)

Parameters:
buf - - buffer to be printed