Package org.owasp.encoder
Class EncodedWriter
java.lang.Object
java.io.Writer
org.owasp.encoder.EncodedWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
EncodedWriter -- A writer the encodes all input for a specific context and writes the encoded output to another writer.
-
Constructor Summary
ConstructorsConstructorDescriptionEncodedWriter(Writer out, String contextName) Creates an EncodedWriter that uses the specified encoder to encode all input before sending it to the wrapped writer.EncodedWriter(Writer out, Encoder encoder) Creates an EncodedWriter that uses the specified encoder to encode all input before sending it to the wrapped writer. -
Method Summary
-
Constructor Details
-
EncodedWriter
Creates an EncodedWriter that uses the specified encoder to encode all input before sending it to the wrapped writer.- Parameters:
out- the target for all writesencoder- the encoder to use
-
EncodedWriter
Creates an EncodedWriter that uses the specified encoder to encode all input before sending it to the wrapped writer. This method is equivalent to calling:new EncodedWriter(out, Encoders.forName(contextName));- Parameters:
out- the target for all writescontextName- the encoding context name.- Throws:
UnsupportedContextException- if the contextName is unrecognized or not supported.
-
-
Method Details
-
write
- Specified by:
writein classWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-