FIM.Util.Coder
Class WSStripInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.FilterInputStream
|
+--FIM.Util.Coder.WSStripInputStream
- public class WSStripInputStream
- extends FilterInputStream
An input stream which strips out all whitespace bytes (space, tab, linefeed, carriage return and formfeed).
- Version:
- 1.1, 11 Jan 1997
- Author:
- Glenn Vanderburg
Method Summary |
int |
available()
Returns the number of bytes that can be read without blocking. |
int |
read()
Reads a byte of data. |
int |
read(byte[] b,
int off,
int len)
Reads into an array of bytes.
|
long |
skip(long n)
Skips bytes of input. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WSStripInputStream
public WSStripInputStream(InputStream in)
- Constructs a new WSStripInputStream initialized with the
specified input stream
- Parameters:
in
- the input stream
read
public int read()
throws IOException
- Reads a byte of data. The method will block if no input is available.
- Overrides:
read
in class FilterInputStream
- Returns:
- the byte read, or -1 if the end of the stream is reached.
- Throws:
IOException
- If an I/O error has occurred.
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Reads into an array of bytes.
Blocks until some input is available.
- Overrides:
read
in class FilterInputStream
- Parameters:
b
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes read- Returns:
- the actual number of bytes read, -1 is
returned when the end of the stream is reached.
- Throws:
IOException
- If an I/O error has occurred.
skip
public long skip(long n)
throws IOException
- Skips bytes of input.
- Overrides:
skip
in class FilterInputStream
- Parameters:
n
- bytes to be skipped- Returns:
- actual number of bytes skipped
- Throws:
IOException
- If an I/O error has occurred.
available
public int available()
throws IOException
- Returns the number of bytes that can be read without blocking.
- Overrides:
available
in class FilterInputStream
- Returns:
- the number of available bytes
- Throws:
IOException
- If an I/O error has occurred.
Submit a bug
Copyright 2001,2002 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.