|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.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 ByteParserParsingException
public byte[] getBytes(int count)
throws ParsingException
ByteParsercount bytes.
getBytes in interface ByteParsercount - the number of bytes to read.
ParsingException
public int getByteAsInt()
throws ParsingException
ByteParserint.
getByteAsInt in interface ByteParserParsingException
public int getShortAsInt()
throws ParsingException
ByteParserint.
getShortAsInt in interface ByteParserParsingException
public long getInt()
throws ParsingException
ByteParserlong.
getInt in interface ByteParserParsingException
@Deprecated
public ByteParser getNewParser()
throws ParsingException
ByteParser
getNewParser in interface ByteParserParsingExceptionpublic void setBigEndian(boolean bigEndian)
ByteParser
setBigEndian in interface ByteParserbigEndian - a boolean value true for big-endian mode, false
for non-big-endian mode.
public boolean hasMore()
throws ParsingException
ByteParser
hasMore in interface ByteParserParsingExceptionpublic int getPosition()
ByteParser
getPosition in interface ByteParserpublic int peekByte()
ByteParserByteParser.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 | |||||||||