|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream ikrs.io.StopMarkInputStream
public class StopMarkInputStream
The StopMarkInputStream is an input stream wrapper class that reads bytes from the underlying inputstream until a given stop-mark (byte sequence) is detected or EOF is reached. Closing the StopMarkInputStream will have no effect to the underlying stream.
Constructor Summary | |
---|---|
StopMarkInputStream(java.io.InputStream in,
byte[] stopMark)
Constructs a new StopMarkInputStream with the given underlying stream and stop mark. |
Method Summary | |
---|---|
int |
available()
|
void |
close()
|
boolean |
continueStream()
The continueStream() method resets the stream once the stop mark was reached. |
protected boolean |
continueStream(boolean overrideEOI)
The continueStream() method resets the stream once the stop mark was reached. |
boolean |
eoiReached()
This method just tells if the underlying input stream reached EOI. |
boolean |
isClosed()
This method just tells if this input stream was already closed.. |
static void |
main(java.lang.String[] argv)
|
void |
mark(int readlimit)
|
boolean |
markSupported()
|
int |
read()
|
void |
reset()
|
long |
skip(long n)
|
boolean |
stopMarkReached()
This method just tells if this input stream already reached the stop mark; reaching the stop mark implies reaching EOF. |
java.lang.String |
toString()
|
Methods inherited from class java.io.InputStream |
---|
read, read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StopMarkInputStream(java.io.InputStream in, byte[] stopMark) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
in
- The input stream to read from (must not be null).stopMark
- The stop mark byte sequence (must not be null but may be empty).
java.lang.NullPointerException
java.lang.IllegalArgumentException
Method Detail |
---|
public boolean continueStream()
protected boolean continueStream(boolean overrideEOI)
overrideEOI
- If set to true the next read() call will try to read one
more byte from the underlying stream.
public boolean isClosed()
public boolean stopMarkReached()
public boolean eoiReached()
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
public void mark(int readlimit)
mark
in class java.io.InputStream
public boolean markSupported()
markSupported
in class java.io.InputStream
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |