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 InputStreamprotected final BufferedOutputStream -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new translated input stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidTranslation should be done here.Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skipMethods 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 variableinand the translated output should be written to theBufferedOutputStream(variableout).- Throws:
Exception- Throws any exception so that the ultimate reading program will get it.
-