public class RMDataReader
extends java.lang.Object
Constructor and Description |
---|
RMDataReader(byte[] bytes)
Creates a data reader from the given bytes.
|
RMDataReader(byte[] bytes,
int offset,
int length)
Creates a data reader from the given bytes with the given offset and length.
|
Modifier and Type | Method and Description |
---|---|
short[] |
bigShortArrayAt(int index,
int len)
Returns the array of big endian shorts at the given byte index with the given length.
|
short |
bigShortAtIndex(int index)
Returns the short at the given index (assumed to be in big endian format).
|
long |
bigUIntAtIndex(int index)
Returns the big endian unsigned int at the given byte index.
|
int[] |
bigUShortArrayAt(int index,
int len)
Returns the array of big endian unsigned shorts at the given byte index with the given length.
|
int |
bigUShortAtIndex(int index)
Returns the big endian unsigned short at the given byte index.
|
byte |
byteAt(int index)
Returns the specific byte at the given index.
|
byte[] |
bytes()
Returns the bytes.
|
char[] |
charArrayAt(int index,
int len)
Returns the char array at the given byte index with the given length.
|
void |
getBytes(byte[] bytes,
int start,
int end)
Copies bytes from this to given byte array in given range.
|
void |
getBytes(byte[] bytes,
int start,
int end,
int destStart)
Copies bytes from this to given byte array in given range.
|
static RMDataReader |
getReader(java.lang.Object aSource)
Returns a data reader from the given source File, String path, InputStream, byte[], etc.
|
static RMDataReader |
getReader(java.lang.Object aSource,
int offset,
int length)
Returns a data reader from the given source File, String path, InputStream, byte[], etc.
|
int |
length()
Returns the length of the bytes for the given reader.
|
short |
littleShortAtIndex(int index)
Returns the little endian short at the given byte index.
|
long |
littleUIntAtIndex(int index)
Returns the little endian unsigned int at the given byte index.
|
int |
littleUShortAtIndex(int index)
Returns the little endian unsigned short at the given byte index.
|
int |
offset()
Returns the offset of the bytes for the reader.
|
byte[] |
toByteArray()
Returns a byte array for the reader.
|
byte[] |
toByteArray(int start,
int end)
Returns a byte array for the reader.
|
java.lang.String |
toString()
Returns the reader's bytes as a string.
|
java.lang.String |
toString(int start,
int end,
java.lang.String encoding)
Returns the reader's bytes as a string in the given encoding.
|
short |
ubyteAt(int index)
Returns the specific unsigned byte at the given index.
|
public RMDataReader(byte[] bytes)
public RMDataReader(byte[] bytes, int offset, int length)
public static RMDataReader getReader(java.lang.Object aSource)
public static RMDataReader getReader(java.lang.Object aSource, int offset, int length)
public byte[] bytes()
public byte byteAt(int index)
public short ubyteAt(int index)
public int offset()
public int length()
public byte[] toByteArray()
public byte[] toByteArray(int start, int end)
public void getBytes(byte[] bytes, int start, int end)
public void getBytes(byte[] bytes, int start, int end, int destStart)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int start, int end, java.lang.String encoding)
public short bigShortAtIndex(int index)
public int bigUShortAtIndex(int index)
public short littleShortAtIndex(int index)
public int littleUShortAtIndex(int index)
public long bigUIntAtIndex(int index)
public long littleUIntAtIndex(int index)
public char[] charArrayAt(int index, int len)
public short[] bigShortArrayAt(int index, int len)
public int[] bigUShortArrayAt(int index, int len)