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 BufferedInputStreamprotected final OutputStream -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new translated output stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidTranslation 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 variableoutand 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.
-