public class RMData extends RMObject implements java.io.Serializable
Constructor and Description |
---|
RMData()
Creates an empty RMData.
|
RMData(byte[] bytes)
Creates an RMData with the given byte array.
|
RMData(byte[] bytes,
int len)
Creates an RMData with the given byte array (only to the given length).
|
RMData(int capacity)
Creates an empty RMData with the given capacity.
|
Modifier and Type | Method and Description |
---|---|
RMData |
append(byte[] bytes)
Appends raw binary from byte array to data.
|
RMData |
append(byte[] bytes,
int offset,
int length)
Appends raw binary from byte array to data.
|
RMData |
append(char c)
Append common types as ASCII.
|
RMData |
append(char[] str)
Append the given char array.
|
RMData |
append(char[] str,
int offset,
int length)
Appends the given char array.
|
RMData |
append(double d)
Appends the given double.
|
RMData |
append(float f)
Appends the given float.
|
RMData |
append(int anInt)
Appends an int string to the data.
|
RMData |
append(java.lang.Object o)
Appends an object's string representation to the data.
|
RMData |
append(RMData data)
Appends raw binary from given data to data.
|
RMData |
append(java.lang.String aString)
Appends a string to the data.
|
void |
appendByte(int aByte)
Appends byte to data.
|
void |
appendInt(int anInt)
Appends int to data.
|
void |
appendLittleInt(int anInt)
Appends little endian int to data.
|
void |
appendLittleShort(int aShortInt)
Appends little endian short to data.
|
void |
appendLittleUInt(long aUInt)
Appends little endian unsigned int to data.
|
void |
appendLittleUShort(int aShort)
Appends little endian unsigned short to data.
|
void |
appendShort(int aShortInt)
Appends short to data.
|
void |
appendUByte(int aByte)
Appends unsigned byte to data.
|
byte |
byteAt(int index)
Returns the specific byte at the given index.
|
int |
capacity()
Returns the size of the internal byte array.
|
java.lang.Object |
clone()
Standard clone implementation.
|
void |
ensureCapacity(int minimumCapacity)
Makes sure internal byte array is at least a given size.
|
boolean |
equals(java.lang.Object anObj)
Standard equals implementation.
|
void |
flateCompressedData()
Flate compresses data.
|
byte[] |
getBytes()
Returns the bytes in the data.
|
void |
getBytes(int srcBegin,
int srcEnd,
byte[] destBytes)
Copies the bytes from this data to the given byte array.
|
void |
getBytes(int srcBegin,
int srcEnd,
byte[] destBytes,
int destBegin)
Copies the bytes from this data to the given byte array.
|
static RMData |
getData(java.lang.Object aSource)
Returns an RMData for the given File, String path, InputStream, URL, byte[], etc.
|
java.lang.Object |
initWithArchiver(RMArchiver anArchiver)
Legacy unarchival.
|
java.io.InputStream |
inputStream()
Returns an input stream of this data's bytes.
|
void |
insert(int index,
byte[] bytes)
Inserts raw binary from byte array to data.
|
void |
insert(int index,
byte[] bytes,
int offset,
int length)
Inserts raw binary from byte array to data.
|
void |
insert(int index,
RMData data)
Inserts raw binary from given data to data.
|
void |
insertLittleUIntAtIndex(long aUInt,
int byteIndex)
Inserts little endian unsigned int to data at given index.
|
int |
length()
Returns the length of the data.
|
void |
replace(int start,
int end,
byte[] bytes,
int offset,
int length)
Replace raw binary from byte array in data.
|
void |
setLittleIntAtIndex(int anInt,
int byteIndex)
Sets little endian int to data at given index.
|
void |
setLittleShortAtIndex(int aShortInt,
int byteIndex)
Sets little endian short to data at given index.
|
void |
setLittleUShortAtIndex(int aShort,
int byteIndex)
Sets little endian unsigned short to data at given index.
|
byte[] |
toByteArray()
Returns a byte array for the bytes in the data.
|
byte[] |
toByteArray(int start,
int end)
Returns a byte array for the bytes in the data.
|
java.lang.String |
toString()
Returns the string initialized from the data's bytes (ISO Latin).
|
java.lang.String |
toString(int start,
int end,
java.lang.String encoding)
Returns the string initialized from the data's bytes in the given encoding.
|
void |
writeToFile(java.lang.String aPath)
Writes data to file.
|
copy, didChange, didUndo, getAnimAttribute, getClassNameShort, undoClone, undoCopy, undoEquals
public RMData()
public RMData(int capacity)
public RMData(byte[] bytes)
public RMData(byte[] bytes, int len)
public static RMData getData(java.lang.Object aSource)
public byte[] getBytes()
public byte byteAt(int index)
public int length()
public java.io.InputStream inputStream()
public byte[] toByteArray()
public byte[] toByteArray(int start, int end)
public void getBytes(int srcBegin, int srcEnd, byte[] destBytes)
public void getBytes(int srcBegin, int srcEnd, byte[] destBytes, int destBegin)
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 RMData append(char c)
public RMData append(char[] str)
public RMData append(char[] str, int offset, int length)
public RMData append(double d)
public RMData append(float f)
public RMData append(int anInt)
public RMData append(java.lang.Object o)
public RMData append(java.lang.String aString)
public RMData append(byte[] bytes)
public RMData append(byte[] bytes, int offset, int length)
public void insert(int index, RMData data)
public void insert(int index, byte[] bytes)
public void insert(int index, byte[] bytes, int offset, int length)
public void replace(int start, int end, byte[] bytes, int offset, int length)
public void appendByte(int aByte)
public void appendUByte(int aByte)
public void appendShort(int aShortInt)
public void appendLittleShort(int aShortInt)
public void appendLittleUShort(int aShort)
public void appendInt(int anInt)
public void appendLittleInt(int anInt)
public void appendLittleUInt(long aUInt)
public void setLittleShortAtIndex(int aShortInt, int byteIndex)
public void setLittleUShortAtIndex(int aShort, int byteIndex)
public void setLittleIntAtIndex(int anInt, int byteIndex)
public void insertLittleUIntAtIndex(long aUInt, int byteIndex)
public void flateCompressedData()
public void writeToFile(java.lang.String aPath)
public int capacity()
public void ensureCapacity(int minimumCapacity)
public boolean equals(java.lang.Object anObj)
equals
in class java.lang.Object
public java.lang.Object clone()
public java.lang.Object initWithArchiver(RMArchiver anArchiver)
initWithArchiver
in interface RMArchiver.Archiving
initWithArchiver
in class RMObject