|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--java.io.ByteArrayInputStream | +--com.ericsson.otp.erlang.OtpInputStream
Provides a stream for decoding Erlang terms from external format.
Note that this class is not synchronized, if you need synchronization you must provide it yourself.
Fields inherited from class java.io.ByteArrayInputStream |
buf,
count,
mark,
pos |
Constructor Summary | |
OtpInputStream(byte[] buf)
Create a stream from a buffer containing encoded Erlang terms. |
|
OtpInputStream(byte[] buf,
int offset,
int length)
Create a stream from a buffer containing encoded Erlang terms at the given offset and length. |
Method Summary | |
int |
getPos()
Get the current position in the stream. |
int |
peek()
Look ahead one position in the stream without consuming the byte found there. |
OtpErlangObject |
read_any()
Read an arbitrary Erlang term from the stream. |
java.lang.String |
read_atom()
Read an Erlang atom from the stream. |
byte[] |
read_binary()
Read an Erlang binary from the stream. |
boolean |
read_boolean()
Read an Erlang atom from the stream and interpret the value as a boolean. |
byte |
read_byte()
Read one byte from the stream. |
char |
read_char()
Read a character from the stream. |
double |
read_double()
Read an Erlang float from the stream. |
float |
read_float()
Read an Erlang float from the stream. |
int |
read_int()
Read an integer from the stream. |
int |
read_list_head()
Read a list header from the stream. |
long |
read_long()
Read a long from the stream. |
int |
read_nil()
Read an empty list from the stream. |
OtpErlangPid |
read_pid()
Read an Erlang PID from the stream. |
OtpErlangPort |
read_port()
Read an Erlang port from the stream. |
OtpErlangRef |
read_ref()
Read an Erlang reference from the stream. |
short |
read_short()
Read a short from the stream. |
java.lang.String |
read_string()
Read a string from the stream. |
int |
read_tuple_head()
Read a tuple header from the stream. |
int |
read_uint()
Read an unsigned integer from the stream. |
long |
read_ulong()
Read an unsigned long from the stream. |
short |
read_ushort()
Read an unsigned short from the stream. |
int |
read1()
Read a one byte integer from the stream. |
int |
read2BE()
Read a two byte big endian integer from the stream. |
int |
read2LE()
Read a two byte little endian integer from the stream. |
int |
read4BE()
Read a four byte big endian integer from the stream. |
int |
read4LE()
Read a four byte little endian integer from the stream. |
int |
readN(byte[] buf)
Read an array of bytes from the stream. |
int |
setPos(int pos)
Set the current position in the stream. |
Methods inherited from class java.io.ByteArrayInputStream |
available,
close,
mark,
markSupported,
read,
read,
reset,
skip |
Methods inherited from class java.io.InputStream |
read |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public OtpInputStream(byte[] buf)
public OtpInputStream(byte[] buf, int offset, int length)
Method Detail |
public int getPos()
public int setPos(int pos)
pos
- the position to move to in the stream. If pos
indicates a position beyond the end of the stream, the position
is move to the end of the stream instead. If pos is negative, the
position is moved to the beginning of the stream instead.public int readN(byte[] buf) throws OtpErlangDecodeException
public int peek() throws OtpErlangDecodeException
public int read1() throws OtpErlangDecodeException
public int read2BE() throws OtpErlangDecodeException
public int read4BE() throws OtpErlangDecodeException
public int read2LE() throws OtpErlangDecodeException
public int read4LE() throws OtpErlangDecodeException
public boolean read_boolean() throws OtpErlangDecodeException
public java.lang.String read_atom() throws OtpErlangDecodeException
public byte[] read_binary() throws OtpErlangDecodeException
public float read_float() throws OtpErlangDecodeException
public double read_double() throws OtpErlangDecodeException
public byte read_byte() throws OtpErlangDecodeException
public char read_char() throws OtpErlangDecodeException
public int read_uint() throws OtpErlangDecodeException
public int read_int() throws OtpErlangDecodeException
public short read_ushort() throws OtpErlangDecodeException
public short read_short() throws OtpErlangDecodeException
public long read_ulong() throws OtpErlangDecodeException
public long read_long() throws OtpErlangDecodeException
public int read_list_head() throws OtpErlangDecodeException
public int read_tuple_head() throws OtpErlangDecodeException
public int read_nil() throws OtpErlangDecodeException
public OtpErlangPid read_pid() throws OtpErlangDecodeException
public OtpErlangPort read_port() throws OtpErlangDecodeException
public OtpErlangRef read_ref() throws OtpErlangDecodeException
public java.lang.String read_string() throws OtpErlangDecodeException
public OtpErlangObject read_any() throws OtpErlangDecodeException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |