|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
net.sf.mmm.util.io.impl.ProcessableDetectorInputStream.WrapperInputStream
protected class ProcessableDetectorInputStream.WrapperInputStream
This inner class is the actual wrapper stream.
ProcessableDetectorInputStream.getStream()| Field Summary | |
|---|---|
private InputStream |
delegate
The delegate adapted by this wrapper. |
private boolean |
endOfStream
true if end of detection-stream, false
otherwise. |
private DetectorStreamBuffer |
targetBuffer
The destination buffer (end of chain) |
| Constructor Summary | |
|---|---|
ProcessableDetectorInputStream.WrapperInputStream(InputStream inputStream)
The constructor. |
|
| Method Summary | |
|---|---|
void |
close()
|
protected void |
fill(int requiredBufferLength)
This method tries to ensure that the internal buffer has at least the given number of bytes available. |
void |
process(DetectorStreamBuffer buffer,
Map<String,Object> metadata,
boolean eos)
This method performs the actual detection and optionally manipulates the data. |
int |
read()
|
int |
read(byte[] buffer,
int offset,
int length)
|
long |
skip(long n)
|
| Methods inherited from class java.io.InputStream |
|---|
available, mark, markSupported, read, reset |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final InputStream delegate
private DetectorStreamBuffer targetBuffer
private boolean endOfStream
true if end of detection-stream, false
otherwise.
| Constructor Detail |
|---|
public ProcessableDetectorInputStream.WrapperInputStream(InputStream inputStream)
inputStream - is the InputStream to adapt.| Method Detail |
|---|
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOException
public int read()
throws IOException
read in class InputStreamIOException
public int read(byte[] buffer,
int offset,
int length)
throws IOException
read in class InputStreamIOException
public long skip(long n)
throws IOException
skip in class InputStreamIOException
protected void fill(int requiredBufferLength)
throws IOException
requiredBufferLength - is the desired number of bytes for the
buffer.
IOException - if an I/O error occurred.
public void process(DetectorStreamBuffer buffer,
Map<String,Object> metadata,
boolean eos)
throws IOException
buffer that provides
access to read buffered parts of the stream. As streams are typically
larger pieces of data, this method will be called repetitive in order to
process the entire stream.buffer whenever it is invoked. To ensure your implementation
can always make an appropriate decision it may have to ensure a specific
lookahead.
process in interface DetectorStreamProcessorbuffer - allows you to read parts of the streamed data as well as to
manipulate the data.metadata - is the Map with the meta-data.eos - - true if the end of the stream has been reached
and the given buffer has to be
IOException - in case of an Input/Output error. Should only be used
internally.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||