public class OtpErlangBitstr extends OtpErlangObject
OtpErlangObject.Hash| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
bin |
protected int |
pad_bits |
hashCodeValue| Constructor and Description |
|---|
OtpErlangBitstr(byte[] bin)
Create a bitstr from a byte array
|
OtpErlangBitstr(byte[] bin,
int pad_bits)
Create a bitstr with pad bits from a byte array.
|
OtpErlangBitstr(java.lang.Object o)
Create a bitstr from an arbitrary Java Object.
|
OtpErlangBitstr(OtpInputStream buf)
Create a bitstr from a stream containing a bitstr encoded in Erlang
external format.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
binaryValue()
Get the byte array from a bitstr, padded with zero bits in the little end
of the last byte.
|
java.lang.Object |
clone() |
protected int |
doHashCode() |
void |
encode(OtpOutputStream buf)
Convert this bitstr to the equivalent Erlang external representation.
|
boolean |
equals(java.lang.Object o)
Determine if two bitstrs are equal.
|
java.lang.Object |
getObject()
Get the java Object from the bitstr.
|
int |
pad_bits()
Get the number of pad bits in the last byte of the bitstr.
|
int |
size()
Get the size in whole bytes of the bitstr, rest bits in the last byte not
counted.
|
java.lang.String |
toString()
Get the string representation of this bitstr object.
|
bind, decode, hashCode, matchpublic OtpErlangBitstr(byte[] bin)
bin - the array of bytes from which to create the bitstr.public OtpErlangBitstr(byte[] bin,
int pad_bits)
bin - the array of bytes from which to create the bitstr.pad_bits - the number of unused bits in the low end of the last byte.public OtpErlangBitstr(OtpInputStream buf) throws OtpErlangDecodeException
buf - the stream containing the encoded bitstr.OtpErlangDecodeException - if the buffer does not contain a valid external
representation of an Erlang bitstr.public OtpErlangBitstr(java.lang.Object o)
o - the object to serialize and create this bitstr from.public byte[] binaryValue()
public int size()
public int pad_bits()
public java.lang.Object getObject()
public java.lang.String toString()
toString in class OtpErlangObjectpublic void encode(OtpOutputStream buf)
encode in class OtpErlangObjectbuf - an output stream to which the encoded bitstr should be
written.public boolean equals(java.lang.Object o)
equals in class OtpErlangObjecto - the bitstr to compare to.protected int doHashCode()
doHashCode in class OtpErlangObjectpublic java.lang.Object clone()
clone in class OtpErlangObject