Class Raw
java.lang.Object
com.github.junrar.io.Raw
Read / write numbers to a byte[] regarding the endianness of the array
- Version:
- $LastChangedRevision$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidincShortLittleEndian(byte[] array, int pos, int dv) Increment a short value at the specified position by the specified amount (little endian).static intreadIntBigEndian(byte[] array, int pos) Read a int value from the byte array at the given position (Big Endian)static intreadIntLittleEndian(byte[] array, int pos) Read an int value from the byte array at the given position (little Endian)static longreadIntLittleEndianAsLong(byte[] array, int pos) Read an long value(unsigned int) from the byte array at the given position (little Endian)static longreadLongBigEndian(byte[] array, int pos) Read a long value from the byte array at the given position (Big Endian)static longreadLongLittleEndian(byte[] array, int pos) Read a long value from the byte array at the given position (little Endian)static shortreadShortBigEndian(byte[] array, int pos) Read a short value from the byte array at the given position (Big Endian)static shortreadShortLittleEndian(byte[] array, int pos) Read a short value from the byte array at the given position (little Endian)static voidwriteIntBigEndian(byte[] array, int pos, int value) Write an int value into the byte array at the given position (Big endian)static voidwriteIntLittleEndian(byte[] array, int pos, int value) Write an int value into the byte array at the given position (little endian)static voidwriteLongBigEndian(byte[] array, int pos, long value) Write a long value into the byte array at the given position (Big endian)static voidwriteLongLittleEndian(byte[] array, int pos, long value) Write a long value into the byte array at the given position (little endian)static voidwriteShortBigEndian(byte[] array, int pos, short value) Write a short value into the byte array at the given position (Big endian)static voidwriteShortLittleEndian(byte[] array, int pos, short value) Write a short value into the byte array at the given position (little endian)
-
Constructor Details
-
Raw
public Raw()
-
-
Method Details
-
readShortBigEndian
public static short readShortBigEndian(byte[] array, int pos) Read a short value from the byte array at the given position (Big Endian)- Parameters:
array- the array to read frompos- the position- Returns:
- the value
-
readIntBigEndian
public static int readIntBigEndian(byte[] array, int pos) Read a int value from the byte array at the given position (Big Endian)- Parameters:
array- the array to read frompos- the offset- Returns:
- the value
-
readLongBigEndian
public static long readLongBigEndian(byte[] array, int pos) Read a long value from the byte array at the given position (Big Endian)- Parameters:
array- the array to read frompos- the offset- Returns:
- the value
-
readShortLittleEndian
public static short readShortLittleEndian(byte[] array, int pos) Read a short value from the byte array at the given position (little Endian)- Parameters:
array- the array to read frompos- the offset- Returns:
- the value
-
readIntLittleEndian
public static int readIntLittleEndian(byte[] array, int pos) Read an int value from the byte array at the given position (little Endian)- Parameters:
array- the array to read frompos- the offset- Returns:
- the value
-
readIntLittleEndianAsLong
public static long readIntLittleEndianAsLong(byte[] array, int pos) Read an long value(unsigned int) from the byte array at the given position (little Endian)- Parameters:
array- .pos- .- Returns:
- .
-
readLongLittleEndian
public static long readLongLittleEndian(byte[] array, int pos) Read a long value from the byte array at the given position (little Endian)- Parameters:
array- the array to read frompos- the offset- Returns:
- the value
-
writeShortBigEndian
public static void writeShortBigEndian(byte[] array, int pos, short value) Write a short value into the byte array at the given position (Big endian)- Parameters:
array- the arraypos- the offsetvalue- the value to write
-
writeIntBigEndian
public static void writeIntBigEndian(byte[] array, int pos, int value) Write an int value into the byte array at the given position (Big endian)- Parameters:
array- the arraypos- the offsetvalue- the value to write
-
writeLongBigEndian
public static void writeLongBigEndian(byte[] array, int pos, long value) Write a long value into the byte array at the given position (Big endian)- Parameters:
array- the arraypos- the offsetvalue- the value to write
-
writeShortLittleEndian
public static void writeShortLittleEndian(byte[] array, int pos, short value) Write a short value into the byte array at the given position (little endian)- Parameters:
array- the arraypos- the offsetvalue- the value to write
-
incShortLittleEndian
public static void incShortLittleEndian(byte[] array, int pos, int dv) Increment a short value at the specified position by the specified amount (little endian).- Parameters:
array- .pos- .dv- .
-
writeIntLittleEndian
public static void writeIntLittleEndian(byte[] array, int pos, int value) Write an int value into the byte array at the given position (little endian)- Parameters:
array- the arraypos- the offsetvalue- the value to write
-
writeLongLittleEndian
public static void writeLongLittleEndian(byte[] array, int pos, long value) Write a long value into the byte array at the given position (little endian)- Parameters:
array- the arraypos- the offsetvalue- the value to write
-