Package com.storedobject.common
Class TranslatedOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.storedobject.common.TranslatedOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
A
FilterOutputStream
that translates its stream on-the-fly while writing.- Author:
- Syam
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BufferedInputStream
protected final OutputStream
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a new translated output stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Translation should be done here.Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
in
-
out
-
-
Constructor Details
-
TranslatedOutputStream
Creates a new translated output stream.- Parameters:
out
- OutputStream object providing the underlying stream.
-
-
Method Details
-
translate
Translation should be done here. Original output stream is available in the variableout
and the translated output should be written to it by reading theBufferedInputStream
(variablein
) and translating it (i.e., read from 'in', translate and write to 'out')- Throws:
Exception
- Throws any exception so that the ultimate reading program will get it.
-