| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ericsson.otp.erlang.OtpErlangObject
com.ericsson.otp.erlang.OtpErlangBitstr
public class OtpErlangBitstr
Provides a Java representation of Erlang bitstrs. An Erlang bitstr is an Erlang binary with a length not an integral number of bytes (8-bit). Anything can be represented as a sequence of bytes can be made into an Erlang bitstr.
| Nested Class Summary | 
|---|
| Nested classes/interfaces inherited from class com.ericsson.otp.erlang.OtpErlangObject | 
|---|
OtpErlangObject.Hash | 
| Field Summary | |
|---|---|
protected  byte[] | 
bin
 | 
protected  int | 
pad_bits
 | 
| Fields inherited from class com.ericsson.otp.erlang.OtpErlangObject | 
|---|
hashCodeValue | 
| Constructor Summary | |
|---|---|
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.  | 
|
| Method Summary | |
|---|---|
 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.  | 
| Methods inherited from class com.ericsson.otp.erlang.OtpErlangObject | 
|---|
bind, decode, hashCode, match | 
| Methods inherited from class java.lang.Object | 
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
protected byte[] bin
protected int pad_bits
| Constructor Detail | 
|---|
public 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.| Method Detail | 
|---|
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
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||