|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream ikrs.io.MultiStopMarkInputStream
public class MultiStopMarkInputStream
The MultiStopMarkInputStream is an enhancement of the normal StopMarkInputStream class, it supports a whole set of stop marks to be passed, which split the underlying inputstream into tokens each time one of the stop mark as found. The order or the passed stop marks is the order the input sequence will be matched for the marks.
Constructor Summary | |
---|---|
MultiStopMarkInputStream(java.io.InputStream in,
java.util.List<byte[]> stopMarks)
Creates a new MultiStopMarkInputStream and creates a copy of the passed stop mark list. |
|
MultiStopMarkInputStream(java.io.InputStream in,
java.util.List<byte[]> stopMarks,
boolean copyList)
Creates a new MultiStopMarkInputStream and creates a copy of the passed stop mark list if the 'copyList' param is set to true. |
Method Summary | |
---|---|
int |
available()
|
void |
close()
|
boolean |
continueStream()
When a stop mark was reached the underlying stream might not have reached EOI yet. |
boolean |
eoiReached()
This method tell whether the underlying stream reached EOI. |
byte[] |
getReachedStopMark()
If a stop mark was reached this method tell which one it was. |
int |
getReachedStopMarkIndex()
If a stop mark was hit this method return its index in the initially passed list. |
boolean |
isClosed()
Determines whether this input stream was already closed. |
static void |
main(java.lang.String[] argv)
Just for testing |
void |
mark(int readlimit)
|
boolean |
markSupported()
|
int |
read()
|
void |
reset()
|
long |
skip(long n)
|
boolean |
stopMarkReached()
This method determines if a stop mark was reached. |
Methods inherited from class java.io.InputStream |
---|
read, read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiStopMarkInputStream(java.io.InputStream in, java.util.List<byte[]> stopMarks) throws java.lang.NullPointerException
in
- The underlying input stream.stopMarks
- A non-empty and non-null list of stop marks to be used. The order of the
marks is the final detection order, beginning at index 0.
java.lang.NullPointerException
- If 'in' is null or 'stopMarks' is null or the list contains
any null items.public MultiStopMarkInputStream(java.io.InputStream in, java.util.List<byte[]> stopMarks, boolean copyList) throws java.lang.NullPointerException
in
- The underlying input stream.stopMarks
- A non-empty and non-null list of stop marks to be used. The order of the
marks is the final detection order, beginning at index 0.copyList
- If set to true the constructor will create an internal copy of the passed
list.
java.lang.NullPointerException
- If 'in' is null or 'stopMarks' is null or the list contains
any null items.Method Detail |
---|
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
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 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 boolean isClosed()
public boolean continueStream()
public boolean stopMarkReached()
public int getReachedStopMarkIndex()
stopMarkReached()
public byte[] getReachedStopMark()
public boolean eoiReached()
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |