|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.io.EndianConverter
public class EndianConverter
Utility to convert little endian data to big endian data. Includes methods
to read from an InputStream
and write to an
OutputStream
.
Todo: extend to convert big endian to little endain data and write to
OutputStream
Constructor Summary | |
---|---|
EndianConverter()
|
Method Summary | |
---|---|
static int |
convert(byte[] srcBuffer,
int[] destBuffer,
int srcLength,
int destOffset,
int destLength)
Converts bytes in little/big endian order in srcBuffer to
big/little endian signed integer (4 bytes long) data. |
static int |
convert(byte[] srcBuffer,
int[] destBuffer,
int srcLength,
int destOffset,
int destLength,
int mask)
Converts bytes in little/big endian order in srcBuffer to
big/little endian integer (4 bytes long) data. |
static int |
convert(byte[] srcBuffer,
long[] destBuffer,
int srcLength,
int destOffset,
int destLength)
Converts bytes in little/big endian order in srcBuffer to
big/little endian long (8 bytes long) data. |
static int |
convert(byte[] srcBuffer,
long[] destBuffer,
int srcLength,
int destOffset,
int destLength,
long mask)
Converts bytes in little/big endian order in srcBuffer to
big/little endian long (8 bytes long) data. |
static int |
convert(byte[] srcBuffer,
short[] destBuffer,
int srcLength,
int destOffset,
int destLength)
Converts byte in little/big endian order in srcBuffer to
big/little endian signed short (2 bytes long) data. |
static int |
convert(byte[] srcBuffer,
short[] destBuffer,
int srcLength,
int destOffset,
int destLength,
short mask)
Converts bytes in little/big endian order in srcBuffer to
big/little endian short (2 bytes long) data. |
static int |
convert(int value)
Convert a little/big endian signed integer to a big/little endian signed integer |
static int |
convert(int blockSize,
byte[] srcBuffer,
int[] destBuffer,
int srcLength,
int destOffset,
int destLength)
Converts bytes in little/big endian order in srcBuffer to
big/little endian signed integer data with a user defined block size of
2, 3, or 4 bytes. |
static int |
convert(int blockSize,
byte[] srcBuffer,
int[] destBuffer,
int srcLength,
int destOffset,
int destLength,
int mask)
Converts bytes in little/big endian order in srcBuffer to
big/little endian signed integer data with a user defined block size of
2, 3, or 4 bytes. |
static long |
convert(long value)
Convert a little/big endian signed long to a big/little endian signed long |
static short |
convert(short value)
Convert a little/big endian signed short to a big/little endian signed short |
static int |
convertLittleEndianToDouble(byte[] srcBuffer,
double[] destBuffer,
int srcLength,
int destOffset,
int destLength)
Converts bytes in srcBuffer in little endian order to double
data. |
static int |
convertLittleEndianToFloat(byte[] srcBuffer,
float[] destBuffer,
int srcLength,
int destOffset,
int destLength)
Converts bytes in srcBuffer in little endian order to float
data. |
static int |
convertToLittleEndian(double[] srcBuffer,
byte[] destBuffer,
int srcOffset,
int srcLength)
Converts double data in srcBuffer to bytes in little
endian order. |
static int |
convertToLittleEndian(float[] srcBuffer,
byte[] destBuffer,
int srcOffset,
int srcLength)
Converts float data in srcBuffer to bytes in little
endian order.For the conversion the Float.floatToIntBits
method is used. |
static int |
convertToLittleEndian(int[] srcBuffer,
byte[] destBuffer,
int srcOffset,
int srcLength)
Converts signed int data in srcBuffer to bytes in little
endian order. |
static int |
convertToLittleEndian(int blockSize,
int[] srcBuffer,
byte[] destBuffer,
int srcOffset,
int srcLength)
Converts signed int data in srcBuffer to bytes in little
endian order with a user defined block size of 1, 2, 3 or 4 (1 is here
for convinience). |
static int |
convertToLittleEndian(long[] srcBuffer,
byte[] destBuffer,
int srcOffset,
int srcLength)
Converts signed long data in srcBuffer to bytes in little
endian order. |
static int |
convertToLittleEndian(short[] srcBuffer,
byte[] destBuffer,
int srcOffset,
int srcLength)
Converts signed short data in srcBuffer to bytes in little
endian order. |
static int |
read(byte[] readBuffer,
int[] destBuffer,
int destOffset,
int destLength,
java.io.InputStream stream)
Reads little/big endian data from an InputStream and
converts it to big/little endian signed int (4 bytes long) data. |
static int |
read(byte[] readBuffer,
int[] destBuffer,
int destOffset,
int destLength,
java.io.InputStream stream,
int mask)
Reads little/big endian data from an InputStream and
converts it to big/little endian int (4 bytes long) data. |
static int |
read(byte[] readBuffer,
short[] destBuffer,
int destOffset,
int destLength,
java.io.InputStream stream)
Reads little/big endian data from an InputStream and
converts it to big/little endian signed short (2 bytes long) data. |
static int |
read(byte[] readBuffer,
short[] destBuffer,
int destOffset,
int destLength,
java.io.InputStream stream,
short mask)
Reads little/big endian data from an InputStream and
converts it to big/little endian short (2 bytes long) data. |
static int |
read(int blockSize,
byte[] readBuffer,
int[] destBuffer,
int destOffset,
int destLength,
java.io.InputStream stream)
Reads little/big endian data from an InputStream and
converts it to to big/little endian signed integer data with a user
defined block size of 1, 2, 3, or 4 bytes (1 is here for conveniance). |
static int |
read(int blockSize,
byte[] readBuffer,
int[] destBuffer,
int destOffset,
int destLength,
java.io.InputStream stream,
int mask)
Reads little/big endian data from an InputStream and
converts it to to big/little endian signed integer data with a user
defined block size of 1, 2, 3, or 4 bytes (1 is here for conveniance). |
static int |
read2ByteBlock(java.io.InputStream stream)
Reads 2 bytes in little/big endian format and converts it to a big/little endian signed int. |
static int |
read3ByteBlock(java.io.InputStream stream)
Reads 3 bytes in little/big endian format and converts it to a big/little endian signed int. |
static int |
read4ByteBlock(java.io.InputStream stream)
Reads 4 bytes in little/big endian format and converts it to a big/little endian signed int. |
static long |
read8ByteBlock(java.io.InputStream stream)
Reads 8 bytes in little/big endian format and converts it to a big/little endian signed long. |
static void |
writeLittleEndian(double[] srcBuffer,
int srcOffset,
int srcLength,
java.io.OutputStream stream,
byte[] tempBuffer)
Writes double data in srcBuffer to stream
in little endian order. |
static void |
writeLittleEndian(float[] srcBuffer,
int srcOffset,
int srcLength,
java.io.OutputStream stream,
byte[] tempBuffer)
Writes float data in srcBuffer to stream
in little endian order. |
static void |
writeLittleEndian(int[] srcBuffer,
int srcOffset,
int srcLength,
java.io.OutputStream stream,
byte[] tempBuffer)
Writes signed int data in srcBuffer to stream
in little endian order. |
static void |
writeLittleEndian(int blockSize,
int[] srcBuffer,
int srcOffset,
int srcLength,
java.io.OutputStream stream,
byte[] tempBuffer)
Writes signed int data in srcBuffer to stream
in little endian order. |
static void |
writeLittleEndian(long[] srcBuffer,
int srcOffset,
int srcLength,
java.io.OutputStream stream,
byte[] tempBuffer)
Writes signed long data in srcBuffer to stream
in little endian order. |
static void |
writeLittleEndian(java.io.OutputStream stream,
int value)
Writes signed int data to stream in little endian order. |
static void |
writeLittleEndian(java.io.OutputStream stream,
long value)
Writes signed long data to stream in little endian order. |
static void |
writeLittleEndian(java.io.OutputStream stream,
short value)
Writes signed short data to stream in little endian order. |
static void |
writeLittleEndian(short[] srcBuffer,
int srcOffset,
int srcLength,
java.io.OutputStream stream,
byte[] tempBuffer)
Writes signed short data in srcBuffer to stream
in little endian order. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EndianConverter()
Method Detail |
---|
public static int convert(byte[] srcBuffer, short[] destBuffer, int srcLength, int destOffset, int destLength)
srcBuffer
to
big/little endian signed short (2 bytes long) data.
srcBuffer
- Bytes in little/big endian order which shall be
converted. The size of the array must be at least 2.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.srcLength
- Number of bytes of srcBuffer
which shall
be processed. Must be <= length of srcBuffer
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Max. number of data to be written in
destBuffer
public static int convert(byte[] srcBuffer, short[] destBuffer, int srcLength, int destOffset, int destLength, short mask)
srcBuffer
to
big/little endian short (2 bytes long) data. Significant bits can be
masked, e. g. to get unsigned 7 bit values use 0x7f
as mask.
srcBuffer
- Bytes in little/big endian order which shall be
converted. The size of the array must be at least 2.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.srcLength
- Number of bytes of srcBuffer
which shall
be processed. Must be <= length of srcBuffer
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Max. number of data to be written in
destBuffer
mask
- Mask for significant bits. Set significant bits to 1.
public static int convert(byte[] srcBuffer, int[] destBuffer, int srcLength, int destOffset, int destLength)
srcBuffer
to
big/little endian signed integer (4 bytes long) data.
srcBuffer
- Bytes in little/big endian order which shall be
converted. The size of the array must be at least 4.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.srcLength
- Number of bytes of srcBuffer
which shall
be processed. Must be <= length of srcBuffer
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Maximum number of data to be written in
destBuffer
public static int convert(byte[] srcBuffer, int[] destBuffer, int srcLength, int destOffset, int destLength, int mask)
srcBuffer
to
big/little endian integer (4 bytes long) data. Significant bits can be
masked, e. g. to get unsigned 31 bit values use 0x7fffffff
as mask.
srcBuffer
- Bytes in little/big endian order which shall be
converted. The size of the array must be at least 4.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.srcLength
- Number of bytes of srcBuffer
which shall
be processed. Must be <= length of srcBuffer
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Maximum number of data to be written in
destBuffer
mask
- Mask for significant bits. Set significant bits to 1.
public static int convert(byte[] srcBuffer, long[] destBuffer, int srcLength, int destOffset, int destLength)
srcBuffer
to
big/little endian long (8 bytes long) data.
srcBuffer
- Bytes in little/big endian order which shall be
converted. The size of the array must be at least 8.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.srcLength
- Number of bytes of srcBuffer
which shall
be processed. Must be <= length of srcBuffer
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Maximum number of data to be written in
destBuffer
public static int convert(byte[] srcBuffer, long[] destBuffer, int srcLength, int destOffset, int destLength, long mask)
srcBuffer
to
big/little endian long (8 bytes long) data. Significant bits can be
masked, e. g. to get unsigned 63 bit values use
0x7fffffffffffffff
as mask.
srcBuffer
- Bytes in little/big endian order which shall be
converted. The size of the array must be at least 8.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.srcLength
- Number of bytes of srcBuffer
which shall
be processed. Must be <= length of srcBuffer
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Maximum number of data to be written in
destBuffer
mask
- Mask for significant bits. Set significant bits to 1.
public static short convert(short value)
value
- number to convertpublic static int convert(int value)
value
- number to convertpublic static long convert(long value)
value
- number to convertpublic static int convertLittleEndianToFloat(byte[] srcBuffer, float[] destBuffer, int srcLength, int destOffset, int destLength)
srcBuffer
in little endian order to float
data.
srcBuffer
- Bytes in little endian order which shall be
converted. The size of the array must be at least 4.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.srcLength
- Number of bytes of srcBuffer
which shall
be processed. Must be <= length of srcBuffer
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Maximum number of data to be written in
destBuffer
public static int convertLittleEndianToDouble(byte[] srcBuffer, double[] destBuffer, int srcLength, int destOffset, int destLength)
srcBuffer
in little endian order to double
data.
srcBuffer
- Bytes in little endian order which shall be
converted. The size of the array must be at least 8.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.srcLength
- Number of bytes of srcBuffer
which shall
be processed. Must be <= length of srcBuffer
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Maximum number of data to be written in
destBuffer
public static int convert(int blockSize, byte[] srcBuffer, int[] destBuffer, int srcLength, int destOffset, int destLength)
srcBuffer
to
big/little endian signed integer data with a user defined block size of
2, 3, or 4 bytes.
srcBuffer
- Bytes in little/big endian order which shall be
converted. The size of the array must be at least
blockSize
.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.srcLength
- Number of bytes of srcBuffer
which shall
be processed. Must be <= length of srcBuffer
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Maximum number of data to be written in
destBuffer
blockSize
- May be 2, 3 or 4.
blockSize
)public static int convert(int blockSize, byte[] srcBuffer, int[] destBuffer, int srcLength, int destOffset, int destLength, int mask)
srcBuffer
to
big/little endian signed integer data with a user defined block size of
2, 3, or 4 bytes. Significant bits can be masked, e. g. to get unsigned
16 bit values use 0xffff
as mask.
blockSize
- May be 2, 3 or 4.srcBuffer
- Bytes in little/big endian order which shall be
converted. The size of the array must be at least
blockSize
.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.srcLength
- Number of bytes of srcBuffer
which shall
be processed. Must be <= length of srcBuffer
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Maximum number of data to be written in
destBuffer
mask
- Mask for significant bits. Set significant bits to 1.
blockSize
)public static int convertToLittleEndian(short[] srcBuffer, byte[] destBuffer, int srcOffset, int srcLength)
srcBuffer
to bytes in little
endian order.
srcBuffer
- Signed short data to be converted. The size of array
must be at least srcOffset
+ srcLength
.destBuffer
- Buffer to store the converted data bytes in little
endian order. The first valid byte will start at 0. The size of
the array must be at least 2.srcOffset
- Offset for reading data from srcBuffer
.srcLength
- Max. Number of data to be processed from
srcBuffer
.
srcBuffer
.
Multiply by 2 to get the number of valid bytes in
destBuffer
.public static int convertToLittleEndian(int[] srcBuffer, byte[] destBuffer, int srcOffset, int srcLength)
srcBuffer
to bytes in little
endian order.
srcBuffer
- Signed int data to be converted. The size of array
must be at least srcOffset
+ srcLength
.destBuffer
- Buffer to store the converted data bytes in little
endian order. The first valid byte will start at 0. The size of
the array must be at least 4.srcOffset
- Offset for reading data from srcBuffer
.srcLength
- Max. Number of data to be processed from
srcBuffer
.
srcBuffer
.
Multiply by 4 to get the number of valid bytes in
destBuffer
.public static int convertToLittleEndian(int blockSize, int[] srcBuffer, byte[] destBuffer, int srcOffset, int srcLength)
srcBuffer
to bytes in little
endian order with a user defined block size of 1, 2, 3 or 4 (1 is here
for convinience).
blockSize
- May be 1, 2, 3 or 4.srcBuffer
- Signed int data to be converted. The size of array
must be at least srcOffset
+ srcLength
.destBuffer
- Buffer to store the converted data bytes in little
endian order. The first valid byte will start at 0. The size of
the array must be at least blockSize
.srcOffset
- Offset for reading data from srcBuffer
.srcLength
- Max. Number of data to be processed from
srcBuffer
.
srcBuffer
.
Multiply by blockSize
to get the number of valid bytes
in destBuffer
.public static int convertToLittleEndian(long[] srcBuffer, byte[] destBuffer, int srcOffset, int srcLength)
srcBuffer
to bytes in little
endian order.
srcBuffer
- Signed long data to be converted. The size of array
must be at least srcOffset
+ srcLength
.destBuffer
- Buffer to store the converted data bytes in little
endian order. The first valid byte will start at 0. The size of
the array must be at least 8.srcOffset
- Offset for reading data from srcBuffer
.srcLength
- Max. Number of data to be processed from
srcBuffer
.
srcBuffer
.
Multiply by 8 to get the number of valid bytes in
destBuffer
.public static int convertToLittleEndian(float[] srcBuffer, byte[] destBuffer, int srcOffset, int srcLength)
srcBuffer
to bytes in little
endian order.For the conversion the Float.floatToIntBits
method is used.
srcBuffer
- Float data to be converted. The size of array
must be at least srcOffset
+ srcLength
.destBuffer
- Buffer to store the converted data bytes in little
endian order. The first valid byte will start at 0. The size of
the array must be at least 4.srcOffset
- Offset for reading data from srcBuffer
.srcLength
- Max. Number of data to be processed from
srcBuffer
.
srcBuffer
.
Multiply by 4 to get the number of valid bytes in
destBuffer
.public static int convertToLittleEndian(double[] srcBuffer, byte[] destBuffer, int srcOffset, int srcLength)
srcBuffer
to bytes in little
endian order. For the conversion the Double.doubleToLongBits
method is used.
srcBuffer
- Double data to be converted. The size of array
must be at least srcOffset
+ srcLength
.destBuffer
- Buffer to store the converted data bytes in little
endian order. The first valid byte will start at 0. The size of
the array must be at least 8.srcOffset
- Offset for reading data from srcBuffer
.srcLength
- Max. Number of data to be processed from
srcBuffer
.
srcBuffer
.
Multiply by 8 to get the number of valid bytes in
destBuffer
.public static int read(byte[] readBuffer, short[] destBuffer, int destOffset, int destLength, java.io.InputStream stream) throws java.io.IOException
InputStream
and
converts it to big/little endian signed short (2 bytes long) data.
readBuffer
- Auxilary Buffer to be used to read from
stream
. Choose an appropriate size (multiple of 2)
depending on the size of the stream. The size of the array must be
at least 2.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Max. number of data to be written in
destBuffer
stream
- InputStream
to read from.
destBuffer
(will be <= destLength).
java.io.IOException
public static int read(byte[] readBuffer, short[] destBuffer, int destOffset, int destLength, java.io.InputStream stream, short mask) throws java.io.IOException
InputStream
and
converts it to big/little endian short (2 bytes long) data.
Significant bits can be masked, e. g. to get unsigned 7 bit values use
0x7f
as mask.
readBuffer
- Auxilary Buffer to be used to read from
stream
. Choose an appropriate size (multiple of 2)
depending on the size of the stream. The size of the array must be
at least 2.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Max. number of data to be written in
destBuffer
stream
- InputStream
to read from.mask
- Mask for significant bits. Set significant bits to 1.
destBuffer
(will be <= destLength).
java.io.IOException
public static int read(byte[] readBuffer, int[] destBuffer, int destOffset, int destLength, java.io.InputStream stream) throws java.io.IOException
InputStream
and
converts it to big/little endian signed int (4 bytes long) data.
readBuffer
- Auxilary Buffer to be used to read from
stream
. Choose an appropriate size (multiple of 4)
depending on the size of the stream. The size of the array must be
at least 4.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Max. number of data to be written in
destBuffer
stream
- InputStream
to read from.
destBuffer
(will be <= destLength).
java.io.IOException
public static int read(byte[] readBuffer, int[] destBuffer, int destOffset, int destLength, java.io.InputStream stream, int mask) throws java.io.IOException
InputStream
and
converts it to big/little endian int (4 bytes long) data. Significant
bits can be masked, e. g. to get unsigned 31 bit values use
0x7fffffff
as mask.
readBuffer
- Auxilary Buffer to be used to read from
stream
. Choose an appropriate size (multiple of 4)
depending on the size of the stream. The size of the array must be
at least 4.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Max. number of data to be written in
destBuffer
stream
- InputStream
to read from.mask
- Mask for significant bits. Set significant bits to 1.
destBuffer
(will be <= destLength).
java.io.IOException
public static int read(int blockSize, byte[] readBuffer, int[] destBuffer, int destOffset, int destLength, java.io.InputStream stream) throws java.io.IOException
InputStream
and
converts it to to big/little endian signed integer data with a user
defined block size of 1, 2, 3, or 4 bytes (1 is here for conveniance).
blockSize
- May be 1, 2, 3 or 4.readBuffer
- Auxilary Buffer to be used to read from
stream
. Choose an appropriate size (multiple of
blockSize
) depending on the size of the stream. The
size of the array must be at least blockSize
.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Max. number of data to be written in
destBuffer
stream
- InputStream
to read from.
destBuffer
(will be <= destLength).
java.io.IOException
public static int read(int blockSize, byte[] readBuffer, int[] destBuffer, int destOffset, int destLength, java.io.InputStream stream, int mask) throws java.io.IOException
InputStream
and
converts it to to big/little endian signed integer data with a user
defined block size of 1, 2, 3, or 4 bytes (1 is here for conveniance).
Significant bits can be masked, e. g. to get unsigned 16 bit values use
0xffff
as mask.
blockSize
- May be 1, 2, 3 or 4.readBuffer
- Auxilary Buffer to be used to read from
stream
. Choose an appropriate size (multiple of
blockSize
) depending on the size of the stream. The
size of the array must be at least blockSize
.destBuffer
- Buffer to store the converted data. The size of the
array must be at least destOffset
+
destLength
.destOffset
- Offset for writing converted data in
destBuffer
.destLength
- Max. number of data to be written in
destBuffer
stream
- InputStream
to read from.mask
- Mask for significant bits. Set significant bits to 1.
destBuffer
(will be <= destLength).
java.io.IOException
public static int read4ByteBlock(java.io.InputStream stream) throws java.io.IOException
java.io.IOException
- if EOF occurs and only one, 2 or 3 bytes were read or
if error during reading occurspublic static int read2ByteBlock(java.io.InputStream stream) throws java.io.IOException
To Convert it to an unsigned int &
the result with
0xffff
.
java.io.IOException
- if EOF occurs and only one bytes was read or
if error during reading occurspublic static int read3ByteBlock(java.io.InputStream stream) throws java.io.IOException
To Convert it to an unsigned int &
the result with
0xffffff
.
java.io.IOException
- if EOF occurs and only one or 2 bytes were read or
if error during reading occurspublic static long read8ByteBlock(java.io.InputStream stream) throws java.io.IOException
To Convert it to an unsigned int &
the result with
0xffffff
.
java.io.IOException
- if EOF occurs and only one or 2 bytes were read or
if error during reading occurspublic static void writeLittleEndian(short[] srcBuffer, int srcOffset, int srcLength, java.io.OutputStream stream, byte[] tempBuffer) throws java.io.IOException
srcBuffer
to stream
in little endian order.
srcBuffer
- Signed short data to be converted. The size of array
must be at least srcOffset
+ srcLength
.srcOffset
- Offset for reading data from srcBuffer
.srcLength
- Max. Number of data to be processed from
srcBuffer
.tempBuffer
- Temporary buffer to store the converted data bytes in
little endian order. The size of the array must be at least 2 and
should be a multiple of 2. Use an appropriate size according to
srcLength
.
java.io.IOException
public static void writeLittleEndian(int[] srcBuffer, int srcOffset, int srcLength, java.io.OutputStream stream, byte[] tempBuffer) throws java.io.IOException
srcBuffer
to stream
in little endian order.
srcBuffer
- Signed short data to be converted. The size of array
must be at least srcOffset
+ srcLength
.srcOffset
- Offset for reading data from srcBuffer
.srcLength
- Max. Number of data to be processed from
srcBuffer
.tempBuffer
- Temporary buffer to store the converted data bytes in
little endian order. The size of the array must be at least 4 and
should be a multiple of 4. Use an appropriate size according to
srcLength
.
java.io.IOException
public static void writeLittleEndian(long[] srcBuffer, int srcOffset, int srcLength, java.io.OutputStream stream, byte[] tempBuffer) throws java.io.IOException
srcBuffer
to stream
in little endian order.
srcBuffer
- Signed short data to be converted. The size of array
must be at least srcOffset
+ srcLength
.srcOffset
- Offset for reading data from srcBuffer
.srcLength
- Max. Number of data to be processed from
srcBuffer
.tempBuffer
- Temporary buffer to store the converted data bytes in
little endian order. The size of the array must be at least 8 and
should be a multiple of 8. Use an appropriate size according to
srcLength
.
java.io.IOException
public static void writeLittleEndian(int blockSize, int[] srcBuffer, int srcOffset, int srcLength, java.io.OutputStream stream, byte[] tempBuffer) throws java.io.IOException
srcBuffer
to stream
in little endian order.
srcBuffer
- Signed short data to be converted. The size of array
must be at least srcOffset
+ srcLength
.srcOffset
- Offset for reading data from srcBuffer
.srcLength
- Max. Number of data to be processed from
srcBuffer
.tempBuffer
- Temporary buffer to store the converted data bytes in
little endian order. The size of the array must be at least
blockSize
and should be a multiple of
blockSize
. Use an appropriate size according to
srcLength
.
java.io.IOException
public static void writeLittleEndian(float[] srcBuffer, int srcOffset, int srcLength, java.io.OutputStream stream, byte[] tempBuffer) throws java.io.IOException
srcBuffer
to stream
in little endian order. For the conversion the
Float.floatToIntBits
method is used.
srcBuffer
- Signed short data to be converted. The size of array
must be at least srcOffset
+ srcLength
.srcOffset
- Offset for reading data from srcBuffer
.srcLength
- Max. Number of data to be processed from
srcBuffer
.tempBuffer
- Temporary buffer to store the converted data bytes in
little endian order. The size of the array must be at least 4 and
should be a multiple of 4. Use an appropriate size according to
srcLength
.
java.io.IOException
public static void writeLittleEndian(double[] srcBuffer, int srcOffset, int srcLength, java.io.OutputStream stream, byte[] tempBuffer) throws java.io.IOException
srcBuffer
to stream
in little endian order. For the conversion the
Double.doubleToLongBits
method is used.
srcBuffer
- Signed short data to be converted. The size of array
must be at least srcOffset
+ srcLength
.srcOffset
- Offset for reading data from srcBuffer
.srcLength
- Max. Number of data to be processed from
srcBuffer
.tempBuffer
- Temporary buffer to store the converted data bytes in
little endian order. The size of the array must be at least 8 and
should be a multiple of 8. Use an appropriate size according to
srcLength
.
java.io.IOException
public static void writeLittleEndian(java.io.OutputStream stream, short value) throws java.io.IOException
stream
in little endian order.
stream
- OutputStream
to write to.value
- Signed short data to be written.
java.io.IOException
public static void writeLittleEndian(java.io.OutputStream stream, int value) throws java.io.IOException
stream
in little endian order.
stream
- OutputStream
to write to.value
- Signed int data to be written.
java.io.IOException
public static void writeLittleEndian(java.io.OutputStream stream, long value) throws java.io.IOException
stream
in little endian order.
stream
- OutputStream
to write to.value
- Signed long data to be written.
java.io.IOException
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |