public class EncodedWriter extends Writer
Constructor and Description |
---|
EncodedWriter(Writer out,
Encoder encoder)
Creates an EncodedWriter that uses the specified encoder to encode all input before sending it to the wrapped writer.
|
EncodedWriter(Writer out,
String contextName)
Creates an EncodedWriter that uses the specified encoder to encode all input before sending it to the wrapped writer.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
void |
write(char[] cbuf,
int off,
int len) |
public EncodedWriter(Writer out, Encoder encoder)
out
- the target for all writesencoder
- the encoder to usepublic EncodedWriter(Writer out, String contextName) throws UnsupportedContextException
new EncodedWriter(out, Encoders.forName(contextName));
out
- the target for all writescontextName
- the encoding context name.UnsupportedContextException
- if the contextName is unrecognized or not supported.public void write(char[] cbuf, int off, int len) throws IOException
write
in class Writer
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Writer
IOException
Copyright © 2011–2020 OWASP (Open Web-Application Security Project). All rights reserved.