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 that encodes all input for a specific context and writes the encoded output to another writer.
- Author:
- Jeff Ichnowski
-
Field Summary
-
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:
write
in classWriter
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-