Package com.storedobject.common
Class TranslatedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.storedobject.common.TranslatedInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
A
FilterInputStream
that translates its stream on-the-fly.- Author:
- Syam
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final InputStream
protected final BufferedOutputStream
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a new translated input stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Translation should be done here.Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
in
-
out
-
-
Constructor Details
-
TranslatedInputStream
Creates a new translated input stream.- Parameters:
in
- a InputStream object providing the underlying stream.
-
-
Method Details
-
translate
Translation should be done here. Original input stream is available in the variablein
and the translated output should be written to theBufferedOutputStream
(variableout
).- Throws:
Exception
- Throws any exception so that the ultimate reading program will get it.
-