|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream com.jkristian.io.FilteredByteInputStream com.jkristian.io.InputFilterInputStream
public class InputFilterInputStream
A filter that transforms input data using FilterOutputStream objects. This is helpful when you need to apply some kind of FilterOutputStream to input data (e.g. from a file or network connection). Without a helper class like this one, it would be necessary to implement a new kind of FilterInputStream that performs the same transformation.
read() returns a negative number (indicating the end of input) once for each time in.read() returns a negative number.
This class is not thread-safe.
Field Summary |
---|
Fields inherited from class com.jkristian.io.FilteredByteInputStream |
---|
CHUNK_LENGTH |
Constructor Summary | |
---|---|
InputFilterInputStream(java.io.InputStream in)
Create a filter that encodes characters using the default encoding. |
|
InputFilterInputStream(java.io.InputStream in,
int chunkLength)
Create a filter that encodes characters using the default encoding. |
Method Summary | |
---|---|
void |
close()
|
protected int |
filterInput()
Copy data from the underlying input stream into the filter chain. |
static void |
main(java.lang.String[] args)
Copy System.in to System.out, base64 encoding and decoding it along the way. |
protected boolean |
ready()
|
Methods inherited from class com.jkristian.io.FilteredByteInputStream |
---|
available, flush, getByteFilter, mark, markSupported, read, read, read, reset, setByteFilter, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InputFilterInputStream(java.io.InputStream in)
in
- the stream from which to read input bytespublic InputFilterInputStream(java.io.InputStream in, int chunkLength)
in
- the stream from which to read input byteschunkLength
- the number of bytes to request in each call to in.read()Method Detail |
---|
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class FilteredByteInputStream
java.io.IOException
protected boolean ready() throws java.io.IOException
ready
in class FilteredByteInputStream
java.io.IOException
protected int filterInput() throws java.io.IOException
FilteredByteInputStream
filterInput
in class FilteredByteInputStream
java.io.IOException
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |