Package com.storedobject.common
Class TranslatedWriter
java.lang.Object
java.io.Writer
java.io.FilterWriter
com.storedobject.common.TranslatedWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
- Direct Known Subclasses:
StringFillerWriter
A
FilterWriter that translates its stream on-the-fly while writing.- Author:
- Syam
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTranslatedWriter(Writer out) Creates a new translated writer. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidTranslation should be done here.
-
Field Details
-
in
-
out
-
-
Constructor Details
-
TranslatedWriter
Creates a new translated writer.- Parameters:
out- Writer object providing the underlying stream.
-
-
Method Details
-
translate
Translation should be done here. Original writer is available in the variableoutand the translated output should be written to it by reading theBufferedReader(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.
-