|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
net.sf.mmm.util.io.impl.ProcessableDetectorOutputStream.WrapperOutputStream
protected class ProcessableDetectorOutputStream.WrapperOutputStream
This inner class is the actual wrapper stream.
ProcessableDetectorOutputStream.getStream()| Field Summary | |
|---|---|
private byte[] |
bytes
An array of buffered bytes or null. |
private int |
count
The number of bytes buffered in bytes. |
private OutputStream |
delegate
The delegate adapted by this wrapper. |
| Constructor Summary | |
|---|---|
ProcessableDetectorOutputStream.WrapperOutputStream(OutputStream outputStream)
The constructor. |
|
| Method Summary | |
|---|---|
void |
close()
|
void |
flush()
|
private void |
flushBuffer()
This method flushes the internal buffer. |
void |
process(DetectorStreamBuffer buffer,
Map<String,Object> metadata,
boolean eos)
This method performs the actual detection and optionally manipulates the data. |
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final OutputStream delegate
private byte[] bytes
null.
private int count
bytes.
| Constructor Detail |
|---|
public ProcessableDetectorOutputStream.WrapperOutputStream(OutputStream outputStream)
outputStream - is the OutputStream to adapt.| Method Detail |
|---|
public void close()
throws IOException
close in interface Closeableclose in class OutputStreamIOException
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOException
private void flushBuffer()
throws IOException
buffer.
IOException - if the underlying OutputStream caused such
exception.
public void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOException
public void write(byte[] b)
throws IOException
write in class OutputStreamIOException
public void write(int b)
throws IOException
write in class OutputStreamIOException
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 | |||||||||