Package net.handle.util
Class AsciiJsonWriter
java.lang.Object
java.io.Writer
net.handle.util.AsciiJsonWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
Class which wraps another
Writer
in order to write only ASCII. Non-ASCII characters are JSON-encoded as \u####.
Suggested for use with Gson as in
gson.toJson(json, new AsciiJsonWriter(new BufferedWriter(writer)));
-
Constructor Details
-
AsciiJsonWriter
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
-
write
- Specified by:
write
in classWriter
- Throws:
IOException
-