public class DotKludgeStream
extends java.io.FilterInputStream
This class is used in the ProgressLexer
to handle files where the
last statement is not followed by the dot.
Modifier and Type | Field and Description |
---|---|
private boolean |
eof
Next read will signal EOF condition on the underlying stream.
|
private int |
lastChar
Keeps the last read character.
|
private int |
markChar
Keeps the last read character at the mark point.
|
private boolean |
markEof
Next read after mark point will signal EOF condition.
|
Constructor and Description |
---|
DotKludgeStream(java.io.InputStream in)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
mark(int readlimit)
Marks the current position in this input stream.
|
int |
read()
Reads the next byte from the input stream.
|
void |
reset()
Repositions this stream to the position at the time the mark method
was last called on this input stream.
|
private int lastChar
private boolean eof
private int markChar
private boolean markEof
public DotKludgeStream(java.io.InputStream in)
in
- an input stream of any kind.public void mark(int readlimit)
The general contract of mark is that, if the method markSupported
returns true
, the stream remembers all the bytes read
after the call to mark and stands ready to supply those same bytes
again if and whenever the method reset is called. However, the stream
is not required to remember any data at all if more than readlimit
bytes are read from the stream before reset is called.
Maintains state necessary to restore the current read position.
mark
in class java.io.FilterInputStream
readlimit
- The maximum limit of bytes that can be read before the mark
position becomes invalid.public void reset() throws java.io.IOException
reset
in class java.io.FilterInputStream
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException