public class JSONWriter
extends java.io.FilterWriter
Constructor and Description |
---|
JSONWriter(java.io.Writer out)
Construct a new JSONWriter.
|
Modifier and Type | Method and Description |
---|---|
void |
write(java.lang.Object o)
Write a java object as a JSON value string.
|
void |
write(java.lang.String str)
Writes a string as a JSON string.
|
void |
write(java.lang.String str,
int off,
int len)
Writes a portion of a string as a JSON string.
|
public void write(java.lang.Object o) throws java.io.IOException
o
- Object to writejava.io.IOException
- If an I/O error occurspublic void write(java.lang.String str) throws java.io.IOException
write
in class java.io.Writer
str
- String to writejava.io.IOException
- If an I/O error occurspublic void write(java.lang.String str, int off, int len) throws java.io.IOException, java.lang.IndexOutOfBoundsException
write
in class java.io.FilterWriter
str
- String to be writtenoff
- Offset from which to start reading characterslen
- Number of characters to writejava.io.IOException
- If an I/O error occursjava.lang.IndexOutOfBoundsException
- If off
or len
are negative or if off + len
exceed the length of str