public class LittleEndianUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static int |
readUnsigned2Le(java.nio.ByteBuffer bytes)
Reads 2 bytes in little-endian format and converts them into a 16-bit value.
|
static long |
readUnsigned4Le(java.nio.ByteBuffer bytes)
Reads 4 bytes in little-endian format and converts them into a 32-bit value.
|
static void |
writeUnsigned2Le(java.nio.ByteBuffer output,
int value)
Writes 2 bytes in little-endian format, converting them from a 16-bit value.
|
static void |
writeUnsigned4Le(java.nio.ByteBuffer output,
long value)
Writes 4 bytes in little-endian format, converting them from a 32-bit value.
|
public static long readUnsigned4Le(java.nio.ByteBuffer bytes)
throws java.io.IOException
bytes - from where should the bytes be read; the first 4 bytes of the source will be readjava.io.IOException - failed to read the valuepublic static int readUnsigned2Le(java.nio.ByteBuffer bytes)
throws java.io.IOException
bytes - from where should the bytes be read; the first 2 bytes of the source will be readjava.io.IOException - failed to read the valuepublic static void writeUnsigned4Le(java.nio.ByteBuffer output,
long value)
throws java.io.IOException
output - the output stream where the bytes will be writtenvalue - the 32-bit value to convertjava.io.IOException - failed to write the value datapublic static void writeUnsigned2Le(java.nio.ByteBuffer output,
int value)
throws java.io.IOException
output - the output stream where the bytes will be writtenvalue - the 16-bit value to convertjava.io.IOException - failed to write the value data