|
ST-Developer Java Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.steptools.stdev.keystone.Binary
public class Binary
Represents in instance on an EXPRESS BINARY type. A Binary is a sequence of bits that is used to represent bit masks, or (horrors!) BLOBS. This class provides methods (toString and the constructo) which will convert the Part 21 serialization of Binary objects to and from an instance of this class. Note that the P21 serialization uses 4 bit values for each hex digit, but the access methods implemented in the API use 8-bit bytes for packing the data. The get and put methods deal with 8 bit, and not 4 bit values.
| Constructor Summary | |
|---|---|
Binary(Binary other)
Create an empty copy of another binary. |
|
Binary(int len,
int mask_bits)
Create a binary object of the specified length |
|
Binary(String p21str)
Create a Binary object from a Part21-encoded string. |
|
| Method Summary | |
|---|---|
Object |
clone()
Create a copy of this object |
boolean |
equals(Object o)
Determines if two binaries contain the same values |
byte |
get(int index)
Get a sequence of 8 bits from the binary object. |
int |
getMaskedBits()
Gets the number of extra bits in the binary |
int |
hashCode()
Get the has code for this object. |
boolean |
isEmpty()
Determine if this object is empty. |
void |
set(int index,
byte value)
Set a sequence of 8 bits from the binary object. |
int |
size()
Gets the size (in bytes) of the binary. |
int |
sizeInBits()
Determines the length of the binary in bits |
int |
sizeInBytes()
Determines the length of the binary in bytes |
String |
toString()
Convert the binary to a string as specified in Part 21 |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Binary(String p21str)
throws BinarySyntaxException
p21str - A string representation for the binary. This consists of a
set of hex digits. The first digit indicates how many of the bits in
the second digit are signifigant. Each character in the rest of the
string represents four bits of the binary value.
BinarySyntaxException
public Binary(int len,
int mask_bits)
len - The requested length for the binary in bytes.mask_bits - Number of bits to ignore.public Binary(Binary other)
other - The object getting copied.| Method Detail |
|---|
public byte get(int index)
index - The index of the byte to retreive.
IndexOutOfBoundsException
public void set(int index,
byte value)
index - The index of the byte to retreive.value - The value to be set.
IndexOutOfBoundsExceptionpublic int size()
public int sizeInBits()
public int sizeInBytes()
public int getMaskedBits()
public boolean isEmpty()
public boolean equals(Object o)
equals in class Objecto - The other object to compare
public Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
ST-Developer Java Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||