|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.sdsc.grid.io.BinaryDataFormat
public final class BinaryDataFormat
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.
| 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 |
|---|
public BinaryDataFormat()
public BinaryDataFormat(BinaryDataFormat format)
throws java.lang.NullPointerException
format - a BinaryDataFormat to copy
java.lang.NullPointerException - if the given format is a null| Method Detail |
|---|
public final void finalize()
finalize in class java.lang.Objectpublic final boolean equals(BinaryDataFormat bdf)
public final boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final void setMBFByteOrder()
setLBFByteOrder(),
isMBFByteOrder(),
isLBFByteOrder()public final void setLBFByteOrder()
setMBFByteOrder(),
isMBFByteOrder(),
isLBFByteOrder()public final boolean isMBFByteOrder()
setMBFByteOrder(),
setLBFByteOrder()public final boolean isLBFByteOrder()
setMBFByteOrder(),
setLBFByteOrder()
public final void setShortSize(int nBytes)
throws java.lang.IllegalArgumentException
nBytes - the number of file bytes that make up a short
java.lang.IllegalArgumentException - if nBytes is <= 0
public final void setIntSize(int nBytes)
throws java.lang.IllegalArgumentException
nBytes - the number of file bytes that make up an int
java.lang.IllegalArgumentException - if nBytes is <= 0
public final void setLongSize(int nBytes)
throws java.lang.IllegalArgumentException
nBytes - the number of file bytes that make up a long
java.lang.IllegalArgumentException - if nBytes is <= 0
public final void setLongLongSize(int nBytes)
throws java.lang.IllegalArgumentException
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.
nBytes - the number of file bytes that make up a long long
java.lang.IllegalArgumentException - if nBytes is <= 0
public final void setFloatSize(int nBytes)
throws java.lang.IllegalArgumentException
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.
nBytes - the number of file bytes that make up a float
java.lang.IllegalArgumentException - if nBytes is <= 0
or not 4, 8, or 16
public final void setDoubleSize(int nBytes)
throws java.lang.IllegalArgumentException
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.
nBytes - the number of file bytes that make up a double
java.lang.IllegalArgumentException - if nBytes is <= 0
or not 4, 8, or 16
public final void setLongDoubleSize(int nBytes)
throws java.lang.IllegalArgumentException
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.
nBytes - the number of file bytes that make up a long double
java.lang.IllegalArgumentException - if nBytes is <= 0
or not 4, 8, or 16public final int getShortSize()
public final int getIntSize()
public final int getLongSize()
public final int getLongLongSize()
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.
public final int getFloatSize()
public final int getDoubleSize()
public final int getLongDoubleSize()
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.
public final short shortValue(byte[] bytes)
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.
bytes - the byte array supplying the data
public final int unsignedShortValue(byte[] bytes)
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.
bytes - the byte array supplying the data
public final int intValue(byte[] bytes)
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.
bytes - the byte array supplying the data
public final long unsignedIntValue(byte[] bytes)
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.
bytes - the byte array supplying the data
public final long longValue(byte[] bytes)
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.
bytes - the byte array supplying the data
public final long unsignedLongValue(byte[] bytes)
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.
bytes - the byte array supplying the data
public final long longLongValue(byte[] bytes)
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.
bytes - the byte array supplying the data
public final long unsignedLongLongValue(byte[] bytes)
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.
bytes - the byte array supplying the data
public final float floatValue(byte[] bytes)
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.
bytes - the byte array supplying the data
public final double doubleValue(byte[] bytes)
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.
bytes - the byte array supplying the data
public final double longDoubleValue(byte[] bytes)
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.
bytes - the byte array supplying the data
public final short shortValue(byte[] bytes,
int offset)
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.
bytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int unsignedShortValue(byte[] bytes,
int offset)
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.
bytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int intValue(byte[] bytes,
int offset)
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.
bytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final long unsignedIntValue(byte[] bytes,
int offset)
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.
bytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final long longValue(byte[] bytes,
int offset)
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.
bytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final long unsignedLongValue(byte[] bytes,
int offset)
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.
bytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final long longLongValue(byte[] bytes,
int offset)
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.
bytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final long unsignedLongLongValue(byte[] bytes,
int offset)
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.
bytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final float floatValue(byte[] bytes,
int offset)
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.
bytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final double doubleValue(byte[] bytes,
int offset)
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.
bytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final double longDoubleValue(byte[] bytes,
int offset)
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.
bytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final void shortValues(byte[] bytes,
short[] values,
int nValues)
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.
bytes - the byte array supplying the datavalues - the returned list of host-format valuesnValues - the number of values to return
public final void unsignedShortValues(byte[] bytes,
short[] values,
int nValues)
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.
bytes - the byte array supplying the datavalues - the returned list of host-format valuesnValues - the number of values to return
public final void intValues(byte[] bytes,
int[] values,
int nValues)
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.
bytes - the byte array supplying the datavalues - the returned list of host-format valuesnValues - the number of values to return
public final void unsignedIntValues(byte[] bytes,
int[] values,
int nValues)
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.
bytes - the byte array supplying the datavalues - the returned list of host-format valuesnValues - the number of values to return
public final void longValues(byte[] bytes,
long[] values,
int nValues)
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.
bytes - the byte array supplying the datavalues - the returned list of host-format valuesnValues - the number of values to return
public final void unsignedLongValues(byte[] bytes,
long[] values,
int nValues)
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.
bytes - the byte array supplying the datavalues - the returned list of host-format valuesnValues - the number of values to return
public final void longLongValues(byte[] bytes,
long[] values,
int nValues)
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.
bytes - the byte array supplying the datavalues - the returned list of host-format valuesnValues - the number of values to return
public final void unsignedLongLongValues(byte[] bytes,
long[] values,
int nValues)
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.
bytes - the byte array supplying the datavalues - the returned list of host-format valuesnValues - the number of values to return
public final void floatValues(byte[] bytes,
float[] values,
int nValues)
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.
bytes - the byte array supplying the datavalues - the returned list of host-format valuesnValues - the number of values to return
public final void doubleValues(byte[] bytes,
double[] values,
int nValues)
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.
bytes - the byte array supplying the datavalues - the returned list of host-format valuesnValues - the number of values to return
public final void longDoubleValues(byte[] bytes,
double[] values,
int nValues)
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.
bytes - the byte array supplying the datavalues - the returned list of host-format valuesnValues - the number of values to return
public final int encodeShort(short value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeShort(int value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeUnsignedShort(short value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeUnsignedShort(int value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeInt(int value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeUnsignedInt(int value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeUnsignedInt(long value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeLong(long value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeUnsignedLong(long value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeLongLong(long value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeUnsignedLongLong(long value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeFloat(float value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeFloat(double value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeDouble(double value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeLongDouble(double value,
byte[] bytes)
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.
value - the value to convertbytes - the byte array supplying the data
public final int encodeShort(short value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeShort(int value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeUnsignedShort(short value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeUnsignedShort(int value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeInt(int value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeUnsignedInt(int value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeUnsignedInt(long value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeLong(long value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeUnsignedLong(long value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeLongLong(long value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeUnsignedLongLong(long value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeFloat(float value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeFloat(double value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeDouble(double value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeLongDouble(double value,
byte[] bytes,
int offset)
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.
value - the value to convertbytes - the byte array supplying the dataoffset - the starting offset into the byte array
public final int encodeShorts(short[] values,
int nValues,
byte[] bytes)
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.
values - the array of values to convertnValues - the number of values to convertbytes - the byte array supplying the data
public final int encodeUnsignedShorts(short[] values,
int nValues,
byte[] bytes)
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.
values - the array of values to convertnValues - the number of values to convertbytes - the byte array supplying the data
public final int encodeInts(int[] values,
int nValues,
byte[] bytes)
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.
values - the array of values to convertnValues - the number of values to convertbytes - the byte array supplying the data
public final int encodeUnsignedInts(int[] values,
int nValues,
byte[] bytes)
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.
values - the array of values to convertnValues - the number of values to convertbytes - the byte array supplying the data
public final int encodeLongs(long[] values,
int nValues,
byte[] bytes)
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.
values - the array of values to convertnValues - the number of values to convertbytes - the byte array supplying the data
public final int encodeUnsignedLongs(long[] values,
int nValues,
byte[] bytes)
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.
values - the array of values to convertnValues - the number of values to convertbytes - the byte array supplying the data
public final int encodeLongLongs(long[] values,
int nValues,
byte[] bytes)
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.
values - the array of values to convertnValues - the number of values to convertbytes - the byte array supplying the data
public final int encodeUnsignedLongLongs(long[] values,
int nValues,
byte[] bytes)
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.
values - the array of values to convertnValues - the number of values to convertbytes - the byte array supplying the data
public final int encodeFloats(float[] values,
int nValues,
byte[] bytes)
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.
values - the array of values to convertnValues - the number of values to convertbytes - the byte array supplying the data
public final int encodeDoubles(double[] values,
int nValues,
byte[] bytes)
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.
values - the array of values to convertnValues - the number of values to convertbytes - the byte array supplying the data
public final int encodeLongDoubles(double[] values,
int nValues,
byte[] bytes)
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.
values - the array of values to convertnValues - the number of values to convertbytes - the byte array supplying the data
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||