edu.sdsc.grid.io
Class BinaryDataFormat

java.lang.Object
  extended by edu.sdsc.grid.io.BinaryDataFormat

public final class BinaryDataFormat
extends java.lang.Object

The BinaryDataFormat class describes the byte order and primitive data type sizes for binary numeric data. For instance, a format may describe that data is stored with the most-significant byte first and with a "short" taking 2 bytes, an "int" 4 bytes, a "long" 8 bytes, and so on.

Methods on the class set or get a format's attributes. Methods also support using those attributes to control conversion of numeric values into and out of raw byte arrays. These methods are designed for use by binary file readers and writers to enable them to easily map between the binary format of data in a file and that of the current host.

Example
Perhaps a file contains binary data that uses a Least-significant-Byte-First (LBF) byte order (such as Intel processors) with short, int, long, and long long data types that are 2, 4, 4, and 8 bytes in size, respectively. To convert this data to the host's format, first create a BinaryDataFormat object to describe the file's format, and then call that object's shortValue(bytes*b), intValue(bytes*b), longValue(bytes*b), and longLongValue(bytes*b) methods to convert to the host's format:

        // Define the file's binary data attributes
        BinaryDataFormat fileFormat = new BinaryDataFormat( );
        fileFormat.setLBFByteOrder( );
        fileFormat.setShortSize( 2 );
        fileFormat.setIntSize( 4 );
        fileFormat.setLongSize( 4 );
        fileFormat.setLongLongSize( 8 );

        // Read a 4-byte long from the file
        byte b = new byte[4];
        read( fd, b, 4 );

        // Convert it from the file's format to the host's format
        long lng = fileFormat.longValue( b );
 

Conversion methods automatically handle changes in byte order and data type size. For instance, if the host's "long" data type in the code above is actually 8 bytes long and stored Most-significant-Byte-First (MBF), the longValue(bytes*b) method will swap the byte order of the incoming 4-byte file long, then sign-extend or zero-pad the value to create an 8-byte host long.

Similar operations apply for floating-point values of differing byte order and size. All floating point operations assume, however, that the data is in IEEE 754 format. All current processors use this format. Older processors do not, including the IBM 370, VAX, and Cray XMP, YMP, 2, C90, and first generation T90. On older hosts, floating point value handling will not work properly.

Initial values
By default, initial values for all attributes match those of the host executing the application. For instance, initially the number of bytes occupied by a float, as returned by getFloatSize(), equals sizeof(float). Initial values may be changed by calling the set*Size() methods, such as setFloatSize().

Integer values
Methods on this class support integer data types of arbitrary size. Integer data converted from a large to small size may be truncated. Integer data converted from a small to large size will be sign-extended or zero-padded depending upon if the data type is signed or unsigned, respectively.

While this class supports conversions for long long integers, the Java language does not support this data type. As a result, conversion from a long long int into a Java long or int may truncate.

Floating point values
Methods on this class assume that floating point data types conform to the IEEE 754 standard. That standard constrains floating point types to these sizes:

Precision Size
single 4 bytes
double 8 bytes
quadruple 16 bytes

The mapping from these precision sizes to the floating point data types "float", "double", and "long double" supports any combination. For instance, a "double" may be defined as 4 bytes, 8 bytes, or 16 bytes in size. A "double" may even be made smaller than a "float", though this kind of odd configuration probably should not be done.

While this class supports conversions for long doubles, the Java language does not support this data type. As a result, conversion from a long double into a Java double or float may truncate.

Sub-classing
Final


Constructor Summary
BinaryDataFormat()
          Constructs a binary data format description with initial values set to match the attributes of the host.
BinaryDataFormat(BinaryDataFormat format)
          Constructs a binary data format description with initial values copied from the given binary data format.
 
Method Summary
 double doubleValue(byte[] bytes)
          Decodes the binary double value contained in the byte array, and described by this binary data format, into a double in the host's native binary data format.
 double doubleValue(byte[] bytes, int offset)
          Decodes the binary double value contained in the byte array, and described by this binary data format, into a double in the host's native binary data format.
 void doubleValues(byte[] bytes, double[] values, int nValues)
          Decodes the nValues binary double values contained in the byte array, and described by this binary data format, into an array of double in the host's native binary data format.
 int encodeDouble(double value, byte[] bytes)
          Encodes the double value, in the host's native binary data format, into a byte array containing bytes that make up an double described by this binary data format.
 int encodeDouble(double value, byte[] bytes, int offset)
          Encodes the double value, in the host's native binary data format, into a byte array containing bytes that make up an double described by this binary data format.
 int encodeDoubles(double[] values, int nValues, byte[] bytes)
          Encodes an array of double values, in the host's native binary data format, into a byte array containing bytes that make up each double described by this binary data format.
 int encodeFloat(double value, byte[] bytes)
          Encodes the float value, in the host's native binary data format, into a byte array containing bytes that make up an float described by this binary data format.
 int encodeFloat(double value, byte[] bytes, int offset)
          Encodes the float value, in the host's native binary data format, into a byte array containing bytes that make up an float described by this binary data format.
 int encodeFloat(float value, byte[] bytes)
          Encodes the float value, in the host's native binary data format, into a byte array containing bytes that make up an float described by this binary data format.
 int encodeFloat(float value, byte[] bytes, int offset)
          Encodes the float value, in the host's native binary data format, into a byte array containing bytes that make up an float described by this binary data format.
 int encodeFloats(float[] values, int nValues, byte[] bytes)
          Encodes an array of float values, in the host's native binary data format, into a byte array containing bytes that make up each float described by this binary data format.
 int encodeInt(int value, byte[] bytes)
          Encodes the integer value, in the host's native binary data format, into a byte array containing bytes that make up an integer described by this binary data format.
 int encodeInt(int value, byte[] bytes, int offset)
          Encodes the integer value, in the host's native binary data format, into a byte array containing bytes that make up an integer described by this binary data format.
 int encodeInts(int[] values, int nValues, byte[] bytes)
          Encodes an array of int values, in the host's native binary data format, into a byte array containing bytes that make up each int described by this binary data format.
 int encodeLong(long value, byte[] bytes)
          Encodes the long value, in the host's native binary data format, into a byte array containing bytes that make up an long described by this binary data format.
 int encodeLong(long value, byte[] bytes, int offset)
          Encodes the long value, in the host's native binary data format, into a byte array containing bytes that make up an long described by this binary data format.
 int encodeLongDouble(double value, byte[] bytes)
          Encodes the long double value, in the host's native binary data format, into a byte array containing bytes that make up an long double described by this binary data format.
 int encodeLongDouble(double value, byte[] bytes, int offset)
          Encodes the long double value, in the host's native binary data format, into a byte array containing bytes that make up an long double described by this binary data format.
 int encodeLongDoubles(double[] values, int nValues, byte[] bytes)
          Encodes an array of long double values, in the host's native binary data format, into a byte array containing bytes that make up each long double described by this binary data format.
 int encodeLongLong(long value, byte[] bytes)
          Encodes the long long value, in the host's native binary data format, into a byte array containing bytes that make up an long long described by this binary data format.
 int encodeLongLong(long value, byte[] bytes, int offset)
          Encodes the long long value, in the host's native binary data format, into a byte array containing bytes that make up an long long described by this binary data format.
 int encodeLongLongs(long[] values, int nValues, byte[] bytes)
          Encodes an array of long long values, in the host's native binary data format, into a byte array containing bytes that make up each long long described by this binary data format.
 int encodeLongs(long[] values, int nValues, byte[] bytes)
          Encodes an array of long values, in the host's native binary data format, into a byte array containing bytes that make up each long described by this binary data format.
 int encodeShort(int value, byte[] bytes)
          Encodes the short value, in the host's native binary data format, into a byte array containing bytes that make up an short described by this binary data format.
 int encodeShort(int value, byte[] bytes, int offset)
          Encodes the short value, in the host's native binary data format, into a byte array containing bytes that make up an short described by this binary data format.
 int encodeShort(short value, byte[] bytes)
          Encodes the short value, in the host's native binary data format, into a byte array containing bytes that make up an short described by this binary data format.
 int encodeShort(short value, byte[] bytes, int offset)
          Encodes the short value, in the host's native binary data format, into a byte array containing bytes that make up an short described by this binary data format.
 int encodeShorts(short[] values, int nValues, byte[] bytes)
          Encodes an array of short values, in the host's native binary data format, into a byte array containing bytes that make up each short described by this binary data format.
 int encodeUnsignedInt(int value, byte[] bytes)
          Encodes the unsigned integer value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned integer described by this binary data format.
 int encodeUnsignedInt(int value, byte[] bytes, int offset)
          Encodes the unsigned integer value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned integer described by this binary data format.
 int encodeUnsignedInt(long value, byte[] bytes)
          Encodes the unsigned integer value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned integer described by this binary data format.
 int encodeUnsignedInt(long value, byte[] bytes, int offset)
          Encodes the unsigned integer value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned integer described by this binary data format.
 int encodeUnsignedInts(int[] values, int nValues, byte[] bytes)
          Encodes an array of unsigned int values, in the host's native binary data format, into a byte array containing bytes that make up each unsigned int described by this binary data format.
 int encodeUnsignedLong(long value, byte[] bytes)
          Encodes the unsigned long value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned long described by this binary data format.
 int encodeUnsignedLong(long value, byte[] bytes, int offset)
          Encodes the unsigned long value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned long described by this binary data format.
 int encodeUnsignedLongLong(long value, byte[] bytes)
          Encodes the unsigned long long value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned long long described by this binary data format.
 int encodeUnsignedLongLong(long value, byte[] bytes, int offset)
          Encodes the unsigned long long value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned long long described by this binary data format.
 int encodeUnsignedLongLongs(long[] values, int nValues, byte[] bytes)
          Encodes an array of unsigned long long values, in the host's native binary data format, into a byte array containing bytes that make up each unsigned long long described by this binary data format.
 int encodeUnsignedLongs(long[] values, int nValues, byte[] bytes)
          Encodes an array of unsigned long values, in the host's native binary data format, into a byte array containing bytes that make up each unsigned long described by this binary data format.
 int encodeUnsignedShort(int value, byte[] bytes)
          Encodes the unsigned short value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned short described by this binary data format.
 int encodeUnsignedShort(int value, byte[] bytes, int offset)
          Encodes the unsigned short value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned short described by this binary data format.
 int encodeUnsignedShort(short value, byte[] bytes)
          Encodes the unsigned short value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned short described by this binary data format.
 int encodeUnsignedShort(short value, byte[] bytes, int offset)
          Encodes the unsigned short value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned short described by this binary data format.
 int encodeUnsignedShorts(short[] values, int nValues, byte[] bytes)
          Encodes an array of unsigned short values, in the host's native binary data format, into a byte array containing bytes that make up each unsigned short described by this binary data format.
 boolean equals(BinaryDataFormat bdf)
          Indicates whether another binary data format object is equal to this.
 boolean equals(java.lang.Object obj)
          Indicates whether another binary data format object is equal to this.
 void finalize()
          Destroys a binary data format description.
 float floatValue(byte[] bytes)
          Decodes the binary float value contained in the byte array, and described by this binary data format, into a float in the host's native binary data format.
 float floatValue(byte[] bytes, int offset)
          Decodes the binary float value contained in the byte array, and described by this binary data format, into a float in the host's native binary data format.
 void floatValues(byte[] bytes, float[] values, int nValues)
          Decodes the nValues binary float values contained in the byte array, and described by this binary data format, into an array of float in the host's native binary data format.
 int getDoubleSize()
          Gets the number of bytes occupied by a double-precision float.
 int getFloatSize()
          Gets the number of bytes occupied by a single-precision float.
 int getIntSize()
          Gets the number of bytes occupied by an integer.
 int getLongDoubleSize()
          Gets the number of bytes occupied by a long double-precision float.
 int getLongLongSize()
          Gets the number of bytes occupied by a long long integer.
 int getLongSize()
          Gets the number of bytes occupied by a long integer.
 int getShortSize()
          Gets the number of bytes occupied by a short integer.
 int intValue(byte[] bytes)
          Decodes the binary integer value contained in the byte array, and described by this binary data format, into an integer in the host's native binary data format.
 int intValue(byte[] bytes, int offset)
          Decodes the binary integer value contained in the byte array, and described by this binary data format, into an integer in the host's native binary data format.
 void intValues(byte[] bytes, int[] values, int nValues)
          Decodes the nValues binary int values contained in the byte array, and described by this binary data format, into an array of ints in the host's native binary data format.
 boolean isLBFByteOrder()
          Returns true if the binary data byte order is Least-significant-Byte-First (LBF); otherwise false when the byte order is instead Most-significant-Byte-First (MBF).
 boolean isMBFByteOrder()
          Returns true if the binary data byte order is Most-significant-Byte-First (MBF); otherwise false when the byte order is instead Least-significant-Byte-First (LBF).
 double longDoubleValue(byte[] bytes)
          Decodes the binary long double value contained in the byte array, and described by this binary data format, into a long double in the host's native binary data format.
 double longDoubleValue(byte[] bytes, int offset)
          Decodes the binary long double value contained in the byte array, and described by this binary data format, into a long double in the host's native binary data format.
 void longDoubleValues(byte[] bytes, double[] values, int nValues)
          Decodes the nValues binary long double values contained in the byte array, and described by this binary data format, into an array of long double in the host's native binary data format.
 long longLongValue(byte[] bytes)
          Decodes the binary long long value contained in the byte array, and described by this binary data format, into a long long in the host's native binary data format.
 long longLongValue(byte[] bytes, int offset)
          Decodes the binary long long value contained in the byte array, and described by this binary data format, into a long long in the host's native binary data format.
 void longLongValues(byte[] bytes, long[] values, int nValues)
          Decodes the nValues binary long long values contained in the byte array, and described by this binary data format, into an array of long longs in the host's native binary data format.
 long longValue(byte[] bytes)
          Decodes the binary long value contained in the byte array, and described by this binary data format, into a long in the host's native binary data format.
 long longValue(byte[] bytes, int offset)
          Decodes the binary long value contained in the byte array, and described by this binary data format, into a long in the host's native binary data format.
 void longValues(byte[] bytes, long[] values, int nValues)
          Decodes the nValues binary long values contained in the byte array, and described by this binary data format, into an array of longs in the host's native binary data format.
 void setDoubleSize(int nBytes)
          Sets the number of bytes occupied by a double-precision float.
 void setFloatSize(int nBytes)
          Sets the number of bytes occupied by a single-precision float.
 void setIntSize(int nBytes)
          Sets the number of bytes occupied by an integer.
 void setLBFByteOrder()
          Selects the byte order for binary data to be Least-significant-Byte-First (LBF).
 void setLongDoubleSize(int nBytes)
          Sets the number of bytes occupied by a long double-precision float.
 void setLongLongSize(int nBytes)
          Sets the number of bytes occupied by a long long integer.
 void setLongSize(int nBytes)
          Sets the number of bytes occupied by a long integer.
 void setMBFByteOrder()
          Selects the byte order for binary data to be Most-significant-Byte-First (MBF).
 void setShortSize(int nBytes)
          Sets the number of bytes occupied by a short integer.
 short shortValue(byte[] bytes)
          Decodes the binary short value contained in the byte array, and described by this binary data format, into a short in the host's native binary data format.
 short shortValue(byte[] bytes, int offset)
          Decodes the binary short value contained in the byte array, and described by this binary data format, into a short in the host's native binary data format.
 void shortValues(byte[] bytes, short[] values, int nValues)
          Decodes the nValues binary short values contained in the byte array, and described by this binary data format, into an array of shorts in the host's native binary data format.
 long unsignedIntValue(byte[] bytes)
          Decodes the binary unsigned integer value contained in the byte array, and described by this binary data format, into an unsigned integer in the host's native binary data format.
 long unsignedIntValue(byte[] bytes, int offset)
          Decodes the binary unsigned integer value contained in the byte array, and described by this binary data format, into an unsigned integer in the host's native binary data format.
 void unsignedIntValues(byte[] bytes, int[] values, int nValues)
          Decodes the nValues binary unsigned int values contained in the byte array, and described by this binary data format, into an array of unsigned ints in the host's native binary data format.
 long unsignedLongLongValue(byte[] bytes)
          Decodes the binary unsigned long long value contained in the byte array, and described by this binary data format, into an unsigned long long in the host's native binary data format.
 long unsignedLongLongValue(byte[] bytes, int offset)
          Decodes the binary unsigned long long value contained in the byte array, and described by this binary data format, into an unsigned long long in the host's native binary data format.
 void unsignedLongLongValues(byte[] bytes, long[] values, int nValues)
          Decodes the nValues binary unsigned long long values contained in the byte array, and described by this binary data format, into an array of unsigned long longs in the host's native binary data format.
 long unsignedLongValue(byte[] bytes)
          Decodes the binary unsigned long value contained in the byte array, and described by this binary data format, into an unsigned long in the host's native binary data format.
 long unsignedLongValue(byte[] bytes, int offset)
          Decodes the binary unsigned long value contained in the byte array, and described by this binary data format, into an unsigned long in the host's native binary data format.
 void unsignedLongValues(byte[] bytes, long[] values, int nValues)
          Decodes the nValues binary unsigned long values contained in the byte array, and described by this binary data format, into an array of unsigned longs in the host's native binary data format.
 int unsignedShortValue(byte[] bytes)
          Decodes the binary unsigned short value contained in the byte array, and described by this binary data format, into an unsigned short in the host's native binary data format.
 int unsignedShortValue(byte[] bytes, int offset)
          Decodes the binary unsigned short value contained in the byte array, and described by this binary data format, into an unsigned short in the host's native binary data format.
 void unsignedShortValues(byte[] bytes, short[] values, int nValues)
          Decodes the nValues binary unsigned short values contained in the byte array, and described by this binary data format, into an array of unsigned shorts in the host's native binary data format.
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryDataFormat

public BinaryDataFormat()
Constructs a binary data format description with initial values set to match the attributes of the host.


BinaryDataFormat

public BinaryDataFormat(BinaryDataFormat format)
                 throws java.lang.NullPointerException
Constructs a binary data format description with initial values copied from the given binary data format. If the given format is null, a NullPointerException is thrown.

Parameters:
format - a BinaryDataFormat to copy
Throws:
java.lang.NullPointerException - if the given format is a null
Method Detail

finalize

public final void finalize()
Destroys a binary data format description.

Overrides:
finalize in class java.lang.Object

equals

public final boolean equals(BinaryDataFormat bdf)
Indicates whether another binary data format object is equal to this. For such an object to be equal, it must describe the same byte order and data type sizes as this object.

Returns:
true if the objects are equal; false otherwise

equals

public final boolean equals(java.lang.Object obj)
Indicates whether another binary data format object is equal to this. For such an object to be equal, it must describe the same byte order and data type sizes as this object.

Overrides:
equals in class java.lang.Object
Returns:
true if the objects are equal; false otherwise

setMBFByteOrder

public final void setMBFByteOrder()
Selects the byte order for binary data to be Most-significant-Byte-First (MBF).

See Also:
setLBFByteOrder(), isMBFByteOrder(), isLBFByteOrder()

setLBFByteOrder

public final void setLBFByteOrder()
Selects the byte order for binary data to be Least-significant-Byte-First (LBF).

See Also:
setMBFByteOrder(), isMBFByteOrder(), isLBFByteOrder()

isMBFByteOrder

public final boolean isMBFByteOrder()
Returns true if the binary data byte order is Most-significant-Byte-First (MBF); otherwise false when the byte order is instead Least-significant-Byte-First (LBF).

Returns:
true if MBF; false if LBF
See Also:
setMBFByteOrder(), setLBFByteOrder()

isLBFByteOrder

public final boolean isLBFByteOrder()
Returns true if the binary data byte order is Least-significant-Byte-First (LBF); otherwise false when the byte order is instead Most-significant-Byte-First (MBF).

Returns:
true if LBF; false if MBF
See Also:
setMBFByteOrder(), setLBFByteOrder()

setShortSize

public final void setShortSize(int nBytes)
                        throws java.lang.IllegalArgumentException
Sets the number of bytes occupied by a short integer.

Parameters:
nBytes - the number of file bytes that make up a short
Throws:
java.lang.IllegalArgumentException - if nBytes is <= 0

setIntSize

public final void setIntSize(int nBytes)
                      throws java.lang.IllegalArgumentException
Sets the number of bytes occupied by an integer.

Parameters:
nBytes - the number of file bytes that make up an int
Throws:
java.lang.IllegalArgumentException - if nBytes is <= 0

setLongSize

public final void setLongSize(int nBytes)
                       throws java.lang.IllegalArgumentException
Sets the number of bytes occupied by a long integer.

Parameters:
nBytes - the number of file bytes that make up a long
Throws:
java.lang.IllegalArgumentException - if nBytes is <= 0

setLongLongSize

public final void setLongLongSize(int nBytes)
                           throws java.lang.IllegalArgumentException
Sets the number of bytes occupied by a long long integer.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
nBytes - the number of file bytes that make up a long long
Throws:
java.lang.IllegalArgumentException - if nBytes is <= 0

setFloatSize

public final void setFloatSize(int nBytes)
                        throws java.lang.IllegalArgumentException
Sets the number of bytes occupied by a single-precision float.

The IEEE 754 specification recognizes floating point values that are 4, 8, or 16 bytes in size. An IllegalArgumentException is thrown if the given size is not one of these.

Parameters:
nBytes - the number of file bytes that make up a float
Throws:
java.lang.IllegalArgumentException - if nBytes is <= 0 or not 4, 8, or 16

setDoubleSize

public final void setDoubleSize(int nBytes)
                         throws java.lang.IllegalArgumentException
Sets the number of bytes occupied by a double-precision float.

The IEEE 754 specification recognizes floating point values that are 4, 8, or 16 bytes in size. An IllegalArgumentException is thrown if the given size is not one of these.

Parameters:
nBytes - the number of file bytes that make up a double
Throws:
java.lang.IllegalArgumentException - if nBytes is <= 0 or not 4, 8, or 16

setLongDoubleSize

public final void setLongDoubleSize(int nBytes)
                             throws java.lang.IllegalArgumentException
Sets the number of bytes occupied by a long double-precision float.

The IEEE 754 specification recognizes floating point values that are 4, 8, or 16 bytes in size. An IllegalArgumentException is thrown if the given size is not one of these.

Java doesn't support long double types directly. While long double values may be manipulated using this class, if decoded, the largest returnable portion of the long double is a Java double. Similarly, the largest encodable value into a long double is one from a Java double.

Parameters:
nBytes - the number of file bytes that make up a long double
Throws:
java.lang.IllegalArgumentException - if nBytes is <= 0 or not 4, 8, or 16

getShortSize

public final int getShortSize()
Gets the number of bytes occupied by a short integer.

Returns:
the number of file bytes that make up a short

getIntSize

public final int getIntSize()
Gets the number of bytes occupied by an integer.

Returns:
the number of file bytes that make up an int

getLongSize

public final int getLongSize()
Gets the number of bytes occupied by a long integer.

Returns:
the number of file bytes that make up a long

getLongLongSize

public final int getLongLongSize()
Gets the number of bytes occupied by a long long integer.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Returns:
the number of file bytes that make up a long long

getFloatSize

public final int getFloatSize()
Gets the number of bytes occupied by a single-precision float.

Returns:
the number of file bytes that make up a float

getDoubleSize

public final int getDoubleSize()
Gets the number of bytes occupied by a double-precision float.

Returns:
the number of file bytes that make up a double

getLongDoubleSize

public final int getLongDoubleSize()
Gets the number of bytes occupied by a long double-precision float.

Java doesn't support long double types directly. While long double values may be manipulated using this class, if decoded, the largest returnable portion of the long double is a Java double. Similarly, the largest encodable value into a long double is one from a Java double.

Returns:
the number of file bytes that make up a long double

shortValue

public final short shortValue(byte[] bytes)
Decodes the binary short value contained in the byte array, and described by this binary data format, into a short in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and short size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format short.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's short is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's short is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Parameters:
bytes - the byte array supplying the data
Returns:
the host-format value

unsignedShortValue

public final int unsignedShortValue(byte[] bytes)
Decodes the binary unsigned short value contained in the byte array, and described by this binary data format, into an unsigned short in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and short size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format unsigned short.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's unsigned short is larger than that of the host, truncation may occur.

Java doesn't support unsigned types directly. The unsigned short value is therefore returned as an int, but with the upper bytes padded with zeroes.

Parameters:
bytes - the byte array supplying the data
Returns:
the host-format value (as an int)

intValue

public final int intValue(byte[] bytes)
Decodes the binary integer value contained in the byte array, and described by this binary data format, into an integer in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and integer size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format integer.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's integer is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's integer is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Parameters:
bytes - the byte array supplying the data
Returns:
the host-format value

unsignedIntValue

public final long unsignedIntValue(byte[] bytes)
Decodes the binary unsigned integer value contained in the byte array, and described by this binary data format, into an unsigned integer in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and unsigned integer size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format unsigned integer.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's unsigned integer is larger than that of the host, truncation may occur.

Java doesn't support unsigned types directly. The unsigned int value is therefore returned as a long, but with the upper bytes padded with zeroes.

Parameters:
bytes - the byte array supplying the data
Returns:
the host-format value (as a long)

longValue

public final long longValue(byte[] bytes)
Decodes the binary long value contained in the byte array, and described by this binary data format, into a long in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and long size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format integer.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's long is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's long is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Parameters:
bytes - the byte array supplying the data
Returns:
the host-format value

unsignedLongValue

public final long unsignedLongValue(byte[] bytes)
Decodes the binary unsigned long value contained in the byte array, and described by this binary data format, into an unsigned long in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and unsigned long size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format unsigned long.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's unsigned long is larger than that of the host, truncation may occur.

Java doesn't support unsigned types directly. The unsigned long value is therefore returned as a long.

Parameters:
bytes - the byte array supplying the data
Returns:
the host-format value

longLongValue

public final long longLongValue(byte[] bytes)
Decodes the binary long long value contained in the byte array, and described by this binary data format, into a long long in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and long long size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format integer.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's long long is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's long long is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
bytes - the byte array supplying the data
Returns:
the host-format value

unsignedLongLongValue

public final long unsignedLongLongValue(byte[] bytes)
Decodes the binary unsigned long long value contained in the byte array, and described by this binary data format, into an unsigned long long in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and unsigned long long size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format unsigned long long.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's unsigned long long is larger than that of the host, truncation may occur.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
bytes - the byte array supplying the data
Returns:
the host-format value

floatValue

public final float floatValue(byte[] bytes)
Decodes the binary float value contained in the byte array, and described by this binary data format, into a float in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and float size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format float.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's float is larger than that of the host, truncation may occur.

Parameters:
bytes - the byte array supplying the data
Returns:
the host-format value

doubleValue

public final double doubleValue(byte[] bytes)
Decodes the binary double value contained in the byte array, and described by this binary data format, into a double in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and double size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format double.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's double is larger than that of the host, truncation may occur.

Parameters:
bytes - the byte array supplying the data
Returns:
the host-format value

longDoubleValue

public final double longDoubleValue(byte[] bytes)
Decodes the binary long double value contained in the byte array, and described by this binary data format, into a long double in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and long double size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format long double.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's long double is larger than that of the host, truncation may occur.

Java doesn't support long double types directly. While long double values may be manipulated using this class, if decoded, the largest returnable portion of the long double is a Java double. Similarly, the largest encodable value into a long double is one from a Java double.

Parameters:
bytes - the byte array supplying the data
Returns:
the host-format value

shortValue

public final short shortValue(byte[] bytes,
                              int offset)
Decodes the binary short value contained in the byte array, and described by this binary data format, into a short in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and short size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format short.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's short is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's short is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Parameters:
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the host-format value

unsignedShortValue

public final int unsignedShortValue(byte[] bytes,
                                    int offset)
Decodes the binary unsigned short value contained in the byte array, and described by this binary data format, into an unsigned short in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and short size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format unsigned short.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's unsigned short is larger than that of the host, truncation may occur.

Java doesn't support unsigned types directly. The unsigned short value is therefore returned as an int, but with the upper bytes padded with zeroes.

Parameters:
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the host-format value (as an int)

intValue

public final int intValue(byte[] bytes,
                          int offset)
Decodes the binary integer value contained in the byte array, and described by this binary data format, into an integer in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and integer size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format integer.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's integer is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's integer is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Parameters:
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the host-format value

unsignedIntValue

public final long unsignedIntValue(byte[] bytes,
                                   int offset)
Decodes the binary unsigned integer value contained in the byte array, and described by this binary data format, into an unsigned integer in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and unsigned integer size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format unsigned integer.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's unsigned integer is larger than that of the host, truncation may occur.

Java doesn't support unsigned types directly. The unsigned int value is therefore returned as a long, but with the upper bytes padded with zeroes.

Parameters:
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the host-format value (as a long)

longValue

public final long longValue(byte[] bytes,
                            int offset)
Decodes the binary long value contained in the byte array, and described by this binary data format, into a long in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and long size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format integer.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's long is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's long is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Parameters:
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the host-format value

unsignedLongValue

public final long unsignedLongValue(byte[] bytes,
                                    int offset)
Decodes the binary unsigned long value contained in the byte array, and described by this binary data format, into an unsigned long in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and unsigned long size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format unsigned long.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's unsigned long is larger than that of the host, truncation may occur.

Java doesn't support unsigned types directly. The unsigned long value is therefore returned as a long.

Parameters:
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the host-format value

longLongValue

public final long longLongValue(byte[] bytes,
                                int offset)
Decodes the binary long long value contained in the byte array, and described by this binary data format, into a long long in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and long long size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format integer.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's long long is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's long long is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the host-format value

unsignedLongLongValue

public final long unsignedLongLongValue(byte[] bytes,
                                        int offset)
Decodes the binary unsigned long long value contained in the byte array, and described by this binary data format, into an unsigned long long in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and unsigned long long size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format unsigned long long.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's unsigned long long is larger than that of the host, truncation may occur.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the host-format value

floatValue

public final float floatValue(byte[] bytes,
                              int offset)
Decodes the binary float value contained in the byte array, and described by this binary data format, into a float in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and float size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format float.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's float is larger than that of the host, truncation may occur.

Parameters:
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the host-format value

doubleValue

public final double doubleValue(byte[] bytes,
                                int offset)
Decodes the binary double value contained in the byte array, and described by this binary data format, into a double in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and double size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format double.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's double is larger than that of the host, truncation may occur.

Parameters:
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the host-format value

longDoubleValue

public final double longDoubleValue(byte[] bytes,
                                    int offset)
Decodes the binary long double value contained in the byte array, and described by this binary data format, into a long double in the host's native binary data format. The host-format value is returned.

This binary data format's byte order and long double size is used to extract the appropriate number of bytes from the start of the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format long double.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's long double is larger than that of the host, truncation may occur.

Java doesn't support long double types directly. While long double values may be manipulated using this class, if decoded, the largest returnable portion of the long double is a Java double. Similarly, the largest encodable value into a long double is one from a Java double.

Parameters:
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the host-format value

shortValues

public final void shortValues(byte[] bytes,
                              short[] values,
                              int nValues)
Decodes the nValues binary short values contained in the byte array, and described by this binary data format, into an array of shorts in the host's native binary data format. The host-format values are returned in the values array.

The given values array is presumed to be large enough to receive nValues values. The bytes array is presumed to be large enough to supply data for these values.

This binary data format's byte order and short size is used to extract the appropriate number of bytes for the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format short.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's short is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's short is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Parameters:
bytes - the byte array supplying the data
values - the returned list of host-format values
nValues - the number of values to return

unsignedShortValues

public final void unsignedShortValues(byte[] bytes,
                                      short[] values,
                                      int nValues)
Decodes the nValues binary unsigned short values contained in the byte array, and described by this binary data format, into an array of unsigned shorts in the host's native binary data format. The host-format values are returned in the values array.

The given values array is presumed to be large enough to receive nValues values. The bytes array is presumed to be large enough to supply data for these values.

This binary data format's byte order and unsigned short size is used to extract the appropriate number of bytes for the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format unsigned short.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's unsigned short is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's unsigned short is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Parameters:
bytes - the byte array supplying the data
values - the returned list of host-format values
nValues - the number of values to return

intValues

public final void intValues(byte[] bytes,
                            int[] values,
                            int nValues)
Decodes the nValues binary int values contained in the byte array, and described by this binary data format, into an array of ints in the host's native binary data format. The host-format values are returned in the values array.

The given values array is presumed to be large enough to receive nValues values. The bytes array is presumed to be large enough to supply data for these values.

This binary data format's byte order and int size is used to extract the appropriate number of bytes for the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format int.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's int is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's int is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Parameters:
bytes - the byte array supplying the data
values - the returned list of host-format values
nValues - the number of values to return

unsignedIntValues

public final void unsignedIntValues(byte[] bytes,
                                    int[] values,
                                    int nValues)
Decodes the nValues binary unsigned int values contained in the byte array, and described by this binary data format, into an array of unsigned ints in the host's native binary data format. The host-format values are returned in the values array.

The given values array is presumed to be large enough to receive nValues values. The bytes array is presumed to be large enough to supply data for these values.

This binary data format's byte order and unsigned int size is used to extract the appropriate number of bytes for the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format unsigned int.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's unsigned int is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's unsigned int is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Java doesn't support unsigned types directly. This method is identical to the signed version.

Parameters:
bytes - the byte array supplying the data
values - the returned list of host-format values
nValues - the number of values to return

longValues

public final void longValues(byte[] bytes,
                             long[] values,
                             int nValues)
Decodes the nValues binary long values contained in the byte array, and described by this binary data format, into an array of longs in the host's native binary data format. The host-format values are returned in the values array.

The given values array is presumed to be large enough to receive nValues values. The bytes array is presumed to be large enough to supply data for these values.

This binary data format's byte order and long size is used to extract the appropriate number of bytes for the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format long.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's long is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's long is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Parameters:
bytes - the byte array supplying the data
values - the returned list of host-format values
nValues - the number of values to return

unsignedLongValues

public final void unsignedLongValues(byte[] bytes,
                                     long[] values,
                                     int nValues)
Decodes the nValues binary unsigned long values contained in the byte array, and described by this binary data format, into an array of unsigned longs in the host's native binary data format. The host-format values are returned in the values array.

The given values array is presumed to be large enough to receive nValues values. The bytes array is presumed to be large enough to supply data for these values.

This binary data format's byte order and unsigned long size is used to extract the appropriate number of bytes for the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format unsigned long.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's unsigned long is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's unsigned long is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Parameters:
bytes - the byte array supplying the data
values - the returned list of host-format values
nValues - the number of values to return

longLongValues

public final void longLongValues(byte[] bytes,
                                 long[] values,
                                 int nValues)
Decodes the nValues binary long long values contained in the byte array, and described by this binary data format, into an array of long longs in the host's native binary data format. The host-format values are returned in the values array.

The given values array is presumed to be large enough to receive nValues values. The bytes array is presumed to be large enough to supply data for these values.

This binary data format's byte order and long long size is used to extract the appropriate number of bytes for the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format long long.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's long long is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's long long is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
bytes - the byte array supplying the data
values - the returned list of host-format values
nValues - the number of values to return

unsignedLongLongValues

public final void unsignedLongLongValues(byte[] bytes,
                                         long[] values,
                                         int nValues)
Decodes the nValues binary unsigned long long values contained in the byte array, and described by this binary data format, into an array of unsigned long longs in the host's native binary data format. The host-format values are returned in the values array.

The given values array is presumed to be large enough to receive nValues values. The bytes array is presumed to be large enough to supply data for these values.

This binary data format's byte order and unsigned long long size is used to extract the appropriate number of bytes for the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format unsigned long long.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's unsigned long long is larger than that of the host, truncation may occur.

If the number of bytes in this binary format's unsigned long long is smaller than that of the host, the upper bytes of the returned value are padded with zeroes or ones (sign-extension) depending upon if the value is positive or negative, respectively.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
bytes - the byte array supplying the data
values - the returned list of host-format values
nValues - the number of values to return

floatValues

public final void floatValues(byte[] bytes,
                              float[] values,
                              int nValues)
Decodes the nValues binary float values contained in the byte array, and described by this binary data format, into an array of float in the host's native binary data format. The host-format values are returned in the values array.

The given values array is presumed to be large enough to receive nValues values. The bytes array is presumed to be large enough to supply data for these values.

This binary data format's byte order and float size is used to extract the appropriate number of bytes for the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format float.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's float is larger than that of the host, truncation may occur.

Parameters:
bytes - the byte array supplying the data
values - the returned list of host-format values
nValues - the number of values to return

doubleValues

public final void doubleValues(byte[] bytes,
                               double[] values,
                               int nValues)
Decodes the nValues binary double values contained in the byte array, and described by this binary data format, into an array of double in the host's native binary data format. The host-format values are returned in the values array.

The given values array is presumed to be large enough to receive nValues values. The bytes array is presumed to be large enough to supply data for these values.

This binary data format's byte order and double size is used to extract the appropriate number of bytes for the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format double.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's double is larger than that of the host, truncation may occur.

Parameters:
bytes - the byte array supplying the data
values - the returned list of host-format values
nValues - the number of values to return

longDoubleValues

public final void longDoubleValues(byte[] bytes,
                                   double[] values,
                                   int nValues)
Decodes the nValues binary long double values contained in the byte array, and described by this binary data format, into an array of long double in the host's native binary data format. The host-format values are returned in the values array.

The given values array is presumed to be large enough to receive nValues values. The bytes array is presumed to be large enough to supply data for these values.

This binary data format's byte order and long double size is used to extract the appropriate number of bytes for the byte array. Those bytes may be swapped to match the host's byte order. The bytes are then assembled to form a host-format long double.

If byte swapping is needed, the order of bytes in the given byte array will be reversed, in-place.

If the number of bytes in this binary format's long double is larger than that of the host, truncation may occur.

Java doesn't support long doubles types directly. This method is identical to the double version.

Parameters:
bytes - the byte array supplying the data
values - the returned list of host-format values
nValues - the number of values to return

encodeShort

public final int encodeShort(short value,
                             byte[] bytes)
Encodes the short value, in the host's native binary data format, into a byte array containing bytes that make up an short described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and short size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for a short value.

If the number of bytes in this format's short is smaller than that of the host, truncation may occur.

If the number of bytes in this format's short is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeShort

public final int encodeShort(int value,
                             byte[] bytes)
Encodes the short value, in the host's native binary data format, into a byte array containing bytes that make up an short described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and short size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for a short value.

If the number of bytes in this format's short is smaller than that of the host, truncation may occur.

If the number of bytes in this format's short is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeUnsignedShort

public final int encodeUnsignedShort(short value,
                                     byte[] bytes)
Encodes the unsigned short value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned short described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned short size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an unsigned short value.

If the number of bytes in this format's unsigned short is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned short is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeUnsignedShort

public final int encodeUnsignedShort(int value,
                                     byte[] bytes)
Encodes the unsigned short value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned short described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned short size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an unsigned short value.

If the number of bytes in this format's unsigned short is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned short is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeInt

public final int encodeInt(int value,
                           byte[] bytes)
Encodes the integer value, in the host's native binary data format, into a byte array containing bytes that make up an integer described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and integer size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an integer value.

If the number of bytes in this format's integer is smaller than that of the host, truncation may occur.

If the number of bytes in this format's integer is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeUnsignedInt

public final int encodeUnsignedInt(int value,
                                   byte[] bytes)
Encodes the unsigned integer value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned integer described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned integer size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an unsigned integer value.

If the number of bytes in this format's unsigned integer is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned integer is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeUnsignedInt

public final int encodeUnsignedInt(long value,
                                   byte[] bytes)
Encodes the unsigned integer value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned integer described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned integer size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an unsigned integer value.

If the number of bytes in this format's unsigned integer is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned integer is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeLong

public final int encodeLong(long value,
                            byte[] bytes)
Encodes the long value, in the host's native binary data format, into a byte array containing bytes that make up an long described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and long size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for a long value.

If the number of bytes in this format's long is smaller than that of the host, truncation may occur.

If the number of bytes in this format's long is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeUnsignedLong

public final int encodeUnsignedLong(long value,
                                    byte[] bytes)
Encodes the unsigned long value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned long described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned long size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an unsigned long value.

If the number of bytes in this format's unsigned long is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned long is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeLongLong

public final int encodeLongLong(long value,
                                byte[] bytes)
Encodes the long long value, in the host's native binary data format, into a byte array containing bytes that make up an long long described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and long long size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for a long long value.

If the number of bytes in this format's long long is smaller than that of the host, truncation may occur.

If the number of bytes in this format's long long is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeUnsignedLongLong

public final int encodeUnsignedLongLong(long value,
                                        byte[] bytes)
Encodes the unsigned long long value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned long long described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned long long size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an unsigned long long value.

If the number of bytes in this format's unsigned long long is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned long long is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeFloat

public final int encodeFloat(float value,
                             byte[] bytes)
Encodes the float value, in the host's native binary data format, into a byte array containing bytes that make up an float described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and float size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an float value.

If the number of bytes in this format's float is smaller than that of the host, truncation may occur.

If the number of bytes in this format's float is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeFloat

public final int encodeFloat(double value,
                             byte[] bytes)
Encodes the float value, in the host's native binary data format, into a byte array containing bytes that make up an float described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and float size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an float value.

If the number of bytes in this format's float is smaller than that of the host, truncation may occur.

If the number of bytes in this format's float is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeDouble

public final int encodeDouble(double value,
                              byte[] bytes)
Encodes the double value, in the host's native binary data format, into a byte array containing bytes that make up an double described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and double size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an double value.

If the number of bytes in this format's double is smaller than that of the host, truncation may occur.

If the number of bytes in this format's double is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeLongDouble

public final int encodeLongDouble(double value,
                                  byte[] bytes)
Encodes the long double value, in the host's native binary data format, into a byte array containing bytes that make up an long double described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and long double size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an long double value.

If the number of bytes in this format's long double is smaller than that of the host, truncation may occur.

If the number of bytes in this format's long double is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Java doesn't support long double types directly. While long double values may be manipulated using this class, if decoded, the largest returnable portion of the long double is a Java double. Similarly, the largest encodable value into a long double is one from a Java double.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeShort

public final int encodeShort(short value,
                             byte[] bytes,
                             int offset)
Encodes the short value, in the host's native binary data format, into a byte array containing bytes that make up an short described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and short size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for a short value.

If the number of bytes in this format's short is smaller than that of the host, truncation may occur.

If the number of bytes in this format's short is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeShort

public final int encodeShort(int value,
                             byte[] bytes,
                             int offset)
Encodes the short value, in the host's native binary data format, into a byte array containing bytes that make up an short described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and short size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for a short value.

If the number of bytes in this format's short is smaller than that of the host, truncation may occur.

If the number of bytes in this format's short is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeUnsignedShort

public final int encodeUnsignedShort(short value,
                                     byte[] bytes,
                                     int offset)
Encodes the unsigned short value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned short described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned short size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an unsigned short value.

If the number of bytes in this format's unsigned short is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned short is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeUnsignedShort

public final int encodeUnsignedShort(int value,
                                     byte[] bytes,
                                     int offset)
Encodes the unsigned short value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned short described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned short size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an unsigned short value.

If the number of bytes in this format's unsigned short is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned short is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeInt

public final int encodeInt(int value,
                           byte[] bytes,
                           int offset)
Encodes the integer value, in the host's native binary data format, into a byte array containing bytes that make up an integer described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and integer size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an integer value.

If the number of bytes in this format's integer is smaller than that of the host, truncation may occur.

If the number of bytes in this format's integer is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeUnsignedInt

public final int encodeUnsignedInt(int value,
                                   byte[] bytes,
                                   int offset)
Encodes the unsigned integer value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned integer described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned integer size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an unsigned integer value.

If the number of bytes in this format's unsigned integer is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned integer is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeUnsignedInt

public final int encodeUnsignedInt(long value,
                                   byte[] bytes,
                                   int offset)
Encodes the unsigned integer value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned integer described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned integer size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an unsigned integer value.

If the number of bytes in this format's unsigned integer is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned integer is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeLong

public final int encodeLong(long value,
                            byte[] bytes,
                            int offset)
Encodes the long value, in the host's native binary data format, into a byte array containing bytes that make up an long described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and long size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for a long value.

If the number of bytes in this format's long is smaller than that of the host, truncation may occur.

If the number of bytes in this format's long is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeUnsignedLong

public final int encodeUnsignedLong(long value,
                                    byte[] bytes,
                                    int offset)
Encodes the unsigned long value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned long described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned long size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an unsigned long value.

If the number of bytes in this format's unsigned long is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned long is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeLongLong

public final int encodeLongLong(long value,
                                byte[] bytes,
                                int offset)
Encodes the long long value, in the host's native binary data format, into a byte array containing bytes that make up an long long described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and long long size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for a long long value.

If the number of bytes in this format's long long is smaller than that of the host, truncation may occur.

If the number of bytes in this format's long long is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeUnsignedLongLong

public final int encodeUnsignedLongLong(long value,
                                        byte[] bytes,
                                        int offset)
Encodes the unsigned long long value, in the host's native binary data format, into a byte array containing bytes that make up an unsigned long long described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned long long size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an unsigned long long value.

If the number of bytes in this format's unsigned long long is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned long long is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeFloat

public final int encodeFloat(float value,
                             byte[] bytes,
                             int offset)
Encodes the float value, in the host's native binary data format, into a byte array containing bytes that make up an float described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and float size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an float value.

If the number of bytes in this format's float is smaller than that of the host, truncation may occur.

If the number of bytes in this format's float is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeFloat

public final int encodeFloat(double value,
                             byte[] bytes,
                             int offset)
Encodes the float value, in the host's native binary data format, into a byte array containing bytes that make up an float described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and float size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an float value.

If the number of bytes in this format's float is smaller than that of the host, truncation may occur.

If the number of bytes in this format's float is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeDouble

public final int encodeDouble(double value,
                              byte[] bytes,
                              int offset)
Encodes the double value, in the host's native binary data format, into a byte array containing bytes that make up an double described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and double size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an double value.

If the number of bytes in this format's double is smaller than that of the host, truncation may occur.

If the number of bytes in this format's double is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeLongDouble

public final int encodeLongDouble(double value,
                                  byte[] bytes,
                                  int offset)
Encodes the long double value, in the host's native binary data format, into a byte array containing bytes that make up an long double described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and long double size are used to control how to fill the byte array with the given value. The byte array is assumed to be large enough for an long double value.

If the number of bytes in this format's long double is smaller than that of the host, truncation may occur.

If the number of bytes in this format's long double is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes.

Java doesn't support long double types directly. While long double values may be manipulated using this class, if decoded, the largest returnable portion of the long double is a Java double. Similarly, the largest encodable value into a long double is one from a Java double.

Parameters:
value - the value to convert
bytes - the byte array supplying the data
offset - the starting offset into the byte array
Returns:
the number of bytes set during encoding

encodeShorts

public final int encodeShorts(short[] values,
                              int nValues,
                              byte[] bytes)
Encodes an array of short values, in the host's native binary data format, into a byte array containing bytes that make up each short described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and short size are used to control how to fill the byte array with the given values. The byte array is assumed to be large enough for the given number of short values.

If the number of bytes in this format's short is smaller than that of the host, truncation may occur.

If the number of bytes in this format's short is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
values - the array of values to convert
nValues - the number of values to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeUnsignedShorts

public final int encodeUnsignedShorts(short[] values,
                                      int nValues,
                                      byte[] bytes)
Encodes an array of unsigned short values, in the host's native binary data format, into a byte array containing bytes that make up each unsigned short described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned short size are used to control how to fill the byte array with the given values. The byte array is assumed to be large enough for the given number of unsigned short values.

If the number of bytes in this format's unsigned short is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned short is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
values - the array of values to convert
nValues - the number of values to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeInts

public final int encodeInts(int[] values,
                            int nValues,
                            byte[] bytes)
Encodes an array of int values, in the host's native binary data format, into a byte array containing bytes that make up each int described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and int size are used to control how to fill the byte array with the given values. The byte array is assumed to be large enough for the given number of int values.

If the number of bytes in this format's int is smaller than that of the host, truncation may occur.

If the number of bytes in this format's int is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
values - the array of values to convert
nValues - the number of values to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeUnsignedInts

public final int encodeUnsignedInts(int[] values,
                                    int nValues,
                                    byte[] bytes)
Encodes an array of unsigned int values, in the host's native binary data format, into a byte array containing bytes that make up each unsigned int described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned int size are used to control how to fill the byte array with the given values. The byte array is assumed to be large enough for the given number of unsigned int values.

If the number of bytes in this format's unsigned int is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned int is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
values - the array of values to convert
nValues - the number of values to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeLongs

public final int encodeLongs(long[] values,
                             int nValues,
                             byte[] bytes)
Encodes an array of long values, in the host's native binary data format, into a byte array containing bytes that make up each long described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and long size are used to control how to fill the byte array with the given values. The byte array is assumed to be large enough for the given number of long values.

If the number of bytes in this format's long is smaller than that of the host, truncation may occur.

If the number of bytes in this format's long is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
values - the array of values to convert
nValues - the number of values to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeUnsignedLongs

public final int encodeUnsignedLongs(long[] values,
                                     int nValues,
                                     byte[] bytes)
Encodes an array of unsigned long values, in the host's native binary data format, into a byte array containing bytes that make up each unsigned long described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned long size are used to control how to fill the byte array with the given values. The byte array is assumed to be large enough for the given number of unsigned long values.

If the number of bytes in this format's unsigned long is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned long is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Java doesn't support unsigned types directly. This method is identical to the signed version.

Parameters:
values - the array of values to convert
nValues - the number of values to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeLongLongs

public final int encodeLongLongs(long[] values,
                                 int nValues,
                                 byte[] bytes)
Encodes an array of long long values, in the host's native binary data format, into a byte array containing bytes that make up each long long described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and long long size are used to control how to fill the byte array with the given values. The byte array is assumed to be large enough for the given number of long long values.

If the number of bytes in this format's long long is smaller than that of the host, truncation may occur.

If the number of bytes in this format's long long is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
values - the array of values to convert
nValues - the number of values to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeUnsignedLongLongs

public final int encodeUnsignedLongLongs(long[] values,
                                         int nValues,
                                         byte[] bytes)
Encodes an array of unsigned long long values, in the host's native binary data format, into a byte array containing bytes that make up each unsigned long long described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and unsigned long long size are used to control how to fill the byte array with the given values. The byte array is assumed to be large enough for the given number of unsigned long long values.

If the number of bytes in this format's unsigned long long is smaller than that of the host, truncation may occur.

If the number of bytes in this format's unsigned long long is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Java doesn't support long long types directly. While long long values may be manipulated using this class, if decoded, the largest returnable portion of the long long is a Java long. Similarly, the largest encodable value into a long long is one from a Java long.

Parameters:
values - the array of values to convert
nValues - the number of values to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeFloats

public final int encodeFloats(float[] values,
                              int nValues,
                              byte[] bytes)
Encodes an array of float values, in the host's native binary data format, into a byte array containing bytes that make up each float described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and float size are used to control how to fill the byte array with the given values. The byte array is assumed to be large enough for the given number of float values.

If the number of bytes in this format's float is smaller than that of the host, truncation may occur.

If the number of bytes in this format's float is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
values - the array of values to convert
nValues - the number of values to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeDoubles

public final int encodeDoubles(double[] values,
                               int nValues,
                               byte[] bytes)
Encodes an array of double values, in the host's native binary data format, into a byte array containing bytes that make up each double described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and double size are used to control how to fill the byte array with the given values. The byte array is assumed to be large enough for the given number of double values.

If the number of bytes in this format's double is smaller than that of the host, truncation may occur.

If the number of bytes in this format's double is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Parameters:
values - the array of values to convert
nValues - the number of values to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding

encodeLongDoubles

public final int encodeLongDoubles(double[] values,
                                   int nValues,
                                   byte[] bytes)
Encodes an array of long double values, in the host's native binary data format, into a byte array containing bytes that make up each long double described by this binary data format. Differences in byte order and data type size between the host and this binary data format are handled.

This binary data format's byte order and long double size are used to control how to fill the byte array with the given values. The byte array is assumed to be large enough for the given number of long double values.

If the number of bytes in this format's long double is smaller than that of the host, truncation may occur.

If the number of bytes in this format's long double is larger than that of the host, then the most significant bytes of the byte array will be padded with zeroes or ones (sign-extensions) depending upon if the given value is positive or negative, respectively.

Java doesn't support long double types directly. While long double values may be manipulated using this class, if decoded, the largest returnable portion of the long double is a Java double. Similarly, the largest encodable value into a long double is one from a Java double.

Parameters:
values - the array of values to convert
nValues - the number of values to convert
bytes - the byte array supplying the data
Returns:
the number of bytes set during encoding