org.apache.james.util
Class CharTerminatedInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--org.apache.james.util.CharTerminatedInputStream
- public class CharTerminatedInputStream
- extends InputStream
An InputStream class that terminates the stream when it encounters a
particular byte sequence.
- Version:
- 1.0.0, 24/04/1999
- Author:
- Federico Barbieri
Constructor Summary |
CharTerminatedInputStream(InputStream in,
char[] terminator)
A constructor for this object that takes a stream to be wrapped
and a terminating character sequence. |
Method Summary |
int |
read()
Read a byte off this stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CharTerminatedInputStream
public CharTerminatedInputStream(InputStream in,
char[] terminator)
- A constructor for this object that takes a stream to be wrapped
and a terminating character sequence.
- Parameters:
in
- the InputStream
to be wrappedterminator
- the array of characters that will terminate the stream.
- Throws:
IllegalArgumentException
- if the terminator array is null or empty
read
public int read()
throws IOException
- Read a byte off this stream.
- Specified by:
read
in class InputStream
- Returns:
- the byte read off the stream
- Throws:
IOException
- if an IOException is encountered while reading off the stream
"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."