|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--galaxy.lang.GalaxyObject | +--galaxy.lang.GBinary
This class encapsulates an array of bytes.
Fields inherited from class galaxy.lang.GalaxyObject |
GAL_BINARY, GAL_CLAUSE_FRAME, GAL_FLOAT, GAL_FLOAT_32, GAL_FLOAT_64, GAL_FRAME, GAL_FREE, GAL_INT, GAL_INT_16, GAL_INT_32, GAL_INT_64, GAL_KEYWORD, GAL_LIST, GAL_PRED_FRAME, GAL_PROXY, GAL_PTR, GAL_STRING, GAL_SYMBOL, GAL_TAG, GAL_TOKEN, GAL_TOPIC_FRAME, nameToType, type, typeToName |
Constructor Summary | |
GBinary()
Creates an empty array of bytes. |
|
GBinary(byte[] byteArray)
This constructor creates an object that encapsulates the reference to array of bytes. |
|
GBinary(byte[] byteArray,
boolean makeCopy)
This constructor creates an object that encapsulates the reference to array of bytes. |
Method Summary | |
void |
append(byte[] byteArray)
Appends an array of bytes to this object's array. |
void |
append(GBinary gbinary)
Appends the array of the specified GBinary object
to this object's array. |
byte[] |
getBytes()
Returns reference to this object's array of bytes. |
int |
getSize()
Returns the length of this object's array of bytes. |
static byte[] |
readBinaryFile(java.lang.String file)
Converts a binary file into an array of bytes. |
double[] |
toDoubleArray()
Returns the byte array as an array of floats. |
java.lang.String |
toEncodedString()
|
float[] |
toFloatArray()
Returns the byte array as an array of floats. |
java.lang.String |
toFormattedString()
|
int[] |
toIntArray()
Returns the byte array as an array of integers. |
long[] |
toLongArray()
Returns the byte array as an array of longs. |
short[] |
toShortArray()
Returns the byte array as an array of shorts. |
java.lang.String |
toString()
|
Methods inherited from class galaxy.lang.GalaxyObject |
getNameForObject, getType, getTypeForObject, getTypeName, isArrayType, nameType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GBinary()
public GBinary(byte[] byteArray)
byteArray
- the arraypublic GBinary(byte[] byteArray, boolean makeCopy) throws java.lang.RuntimeException
byteArray
- the arraymakeCopy
- if true, a copy of the array is stored. Otherwise,
the reference to the array is stored.java.lang.RuntimeException
- If there is an error while copying the array.Method Detail |
public int getSize()
getSize
in interface ArrayObject
public void append(byte[] byteArray) throws java.lang.RuntimeException
byteArray
- the array to appendjava.lang.RuntimeException
- If there is an error while appending to the
array.public void append(GBinary gbinary) throws java.lang.RuntimeException
GBinary
object
to this object's array.gbinary
- the GBinary
to appendjava.lang.RuntimeException
- If there is an error while appending to the
array.public byte[] getBytes()
getBytes
in interface ArrayObject
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toEncodedString()
public java.lang.String toFormattedString()
public float[] toFloatArray()
public double[] toDoubleArray()
public short[] toShortArray()
public int[] toIntArray()
public long[] toLongArray()
public static byte[] readBinaryFile(java.lang.String file) throws java.io.IOException
file
- the name of the binary file to convert
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |