|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.rej.util.StreamByteParser
public class StreamByteParser
A ByteParser
subclass providing parsing of a stream
instead of a byte array (as is the case with ByteParser class).
Constructor Summary | |
---|---|
StreamByteParser(java.io.InputStream in)
Initializes a new parser with the given InputStream . |
Method Summary | |
---|---|
byte |
getByte()
Returns the next byte available. |
int |
getByteAsInt()
Returns the next unsigned byte available as an int . |
byte[] |
getBytes(int count)
Returns an array of the next count bytes. |
long |
getInt()
Returns the unsigned value of the next 4 bytes as a long . |
ByteParser |
getNewParser()
Deprecated. |
int |
getPosition()
Returns the current position of this parser. |
int |
getShortAsInt()
Returns the unsigned value of the next two bytes available in the parser as an int . |
boolean |
hasMore()
Returns true if the end of the underlying data source has not been reached yet. |
int |
peekByte()
Returns an unsigned value of the next byte in this parser, without advancing the position of the parser. |
void |
setBigEndian(boolean bigEndian)
Sets the big-endian mode of this parser. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamByteParser(java.io.InputStream in)
InputStream
.
in
- the steam to parse.Method Detail |
---|
public byte getByte() throws ParsingException
ByteParser
getByte
in interface ByteParser
ParsingException
public byte[] getBytes(int count) throws ParsingException
ByteParser
count
bytes.
getBytes
in interface ByteParser
count
- the number of bytes to read.
ParsingException
public int getByteAsInt() throws ParsingException
ByteParser
int
.
getByteAsInt
in interface ByteParser
ParsingException
public int getShortAsInt() throws ParsingException
ByteParser
int
.
getShortAsInt
in interface ByteParser
ParsingException
public long getInt() throws ParsingException
ByteParser
long
.
getInt
in interface ByteParser
ParsingException
@Deprecated public ByteParser getNewParser() throws ParsingException
ByteParser
getNewParser
in interface ByteParser
ParsingException
public void setBigEndian(boolean bigEndian)
ByteParser
setBigEndian
in interface ByteParser
bigEndian
- a boolean value true for big-endian mode, false
for non-big-endian mode.public boolean hasMore() throws ParsingException
ByteParser
hasMore
in interface ByteParser
ParsingException
public int getPosition()
ByteParser
getPosition
in interface ByteParser
public int peekByte()
ByteParser
ByteParser.getByteAsInt()
other
than for the fact that the position is not advanced.
peekByte
in interface ByteParser
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |