|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
com.alibaba.fastjson.serializer.SerializeWriter
public final class SerializeWriter
Constructor Summary | |
---|---|
SerializeWriter()
|
|
SerializeWriter(int initialSize)
Creates a new CharArrayWriter with the specified initial size. |
|
SerializeWriter(SerializerFeature... features)
Creates a new CharArrayWriter. |
Method Summary | |
---|---|
SerializeWriter |
append(char c)
Appends the specified character to this writer. |
SerializeWriter |
append(CharSequence csq)
|
SerializeWriter |
append(CharSequence csq,
int start,
int end)
|
void |
close()
Close the stream. |
void |
config(SerializerFeature feature,
boolean state)
|
void |
expandCapacity(int minimumCapacity)
|
void |
flush()
Flush the stream. |
boolean |
isEnabled(SerializerFeature feature)
|
void |
reset()
Resets the buffer so that you can use it again without throwing away the already allocated buffer. |
int |
size()
Returns the current size of the buffer. |
byte[] |
toBytes(String charsetName)
|
char[] |
toCharArray()
Returns a copy of the input data. |
String |
toString()
Converts input data to a string. |
void |
write(char c)
|
void |
write(char[] c,
int off,
int len)
Writes characters to the buffer. |
void |
write(int c)
Writes a character to the buffer. |
void |
write(String text)
|
void |
write(String str,
int off,
int len)
Write a portion of a string to the buffer. |
void |
writeBooleanArray(boolean[] array)
|
void |
writeByteArray(byte[] bytes)
|
void |
writeFieldEmptyList(char seperator,
String key)
|
void |
writeFieldName(String key)
|
void |
writeFieldName(String key,
boolean checkSpecial)
|
void |
writeFieldNull(char seperator,
String name)
|
void |
writeFieldNullBoolean(char seperator,
String name)
|
void |
writeFieldNullList(char seperator,
String name)
|
void |
writeFieldNullNumber(char seperator,
String name)
|
void |
writeFieldNullString(char seperator,
String name)
|
void |
writeFieldValue(char seperator,
String name,
BigDecimal value)
|
void |
writeFieldValue(char seperator,
String name,
boolean value)
|
void |
writeFieldValue(char seperator,
String name,
char value)
|
void |
writeFieldValue(char seperator,
String name,
double value)
|
void |
writeFieldValue(char seperator,
String name,
Enum<?> value)
|
void |
writeFieldValue(char seperator,
String name,
float value)
|
void |
writeFieldValue(char seperator,
String name,
int value)
|
void |
writeFieldValue(char seperator,
String name,
long value)
|
void |
writeFieldValue(char seperator,
String name,
String value)
|
void |
writeFieldValue1(char seperator,
String name,
boolean value)
|
void |
writeFieldValue1(char seperator,
String name,
int value)
|
void |
writeFieldValue1(char seperator,
String name,
long value)
|
void |
writeInt(int i)
|
void |
writeIntAndChar(int i,
char c)
|
void |
writeIntArray(int[] array)
|
void |
writeKeyWithDoubleQuote(String text)
|
void |
writeKeyWithDoubleQuote(String text,
boolean checkSpecial)
|
void |
writeLong(long i)
|
void |
writeLongAndChar(long i,
char c)
|
void |
writeLongArray(long[] array)
|
void |
writeNull()
|
void |
writeShortArray(short[] array)
|
void |
writeString(String text)
|
void |
writeString(String text,
char seperator)
|
void |
writeTo(OutputStream out,
Charset charset)
|
void |
writeTo(OutputStream out,
String charset)
|
void |
writeTo(Writer out)
Writes the contents of the buffer to another character stream. |
Methods inherited from class java.io.Writer |
---|
write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SerializeWriter()
public SerializeWriter(SerializerFeature... features)
public SerializeWriter(int initialSize)
initialSize
- an int specifying the initial buffer size.
IllegalArgumentException
- if initialSize is negativeMethod Detail |
---|
public void config(SerializerFeature feature, boolean state)
public boolean isEnabled(SerializerFeature feature)
public void write(int c)
write
in class Writer
public void write(char c)
public void write(char[] c, int off, int len)
write
in class Writer
c
- the data to be writtenoff
- the start offset in the datalen
- the number of chars that are writtenpublic void expandCapacity(int minimumCapacity)
public void write(String str, int off, int len)
write
in class Writer
str
- String to be written fromoff
- Offset from which to start reading characterslen
- Number of characters to be writtenpublic void writeTo(Writer out) throws IOException
out
- the output stream to write to
IOException
- If an I/O error occurs.public void writeTo(OutputStream out, String charset) throws IOException
IOException
public void writeTo(OutputStream out, Charset charset) throws IOException
IOException
public SerializeWriter append(CharSequence csq)
append
in interface Appendable
append
in class Writer
public SerializeWriter append(CharSequence csq, int start, int end)
append
in interface Appendable
append
in class Writer
public SerializeWriter append(char c)
An invocation of this method of the form out.append(c) behaves in exactly the same way as the invocation
out.write(c)
append
in interface Appendable
append
in class Writer
c
- The 16-bit character to append
public void reset()
public char[] toCharArray()
public byte[] toBytes(String charsetName)
public int size()
public String toString()
toString
in class Object
public void flush()
flush
in interface Flushable
flush
in class Writer
public void close()
close
in interface Closeable
close
in class Writer
public void writeBooleanArray(boolean[] array) throws IOException
IOException
public void write(String text)
write
in class Writer
public void writeInt(int i)
public void writeShortArray(short[] array) throws IOException
IOException
public void writeByteArray(byte[] bytes)
public void writeIntArray(int[] array)
public void writeIntAndChar(int i, char c)
public void writeLongAndChar(long i, char c) throws IOException
IOException
public void writeLong(long i)
public void writeNull()
public void writeLongArray(long[] array)
public void writeKeyWithDoubleQuote(String text)
public void writeKeyWithDoubleQuote(String text, boolean checkSpecial)
public void writeFieldNull(char seperator, String name)
public void writeFieldEmptyList(char seperator, String key)
public void writeFieldNullString(char seperator, String name)
public void writeFieldNullBoolean(char seperator, String name)
public void writeFieldNullList(char seperator, String name)
public void writeFieldNullNumber(char seperator, String name)
public void writeFieldValue(char seperator, String name, char value)
public void writeFieldValue(char seperator, String name, boolean value)
public void writeFieldValue1(char seperator, String name, boolean value)
public void writeFieldValue(char seperator, String name, int value)
public void writeFieldValue1(char seperator, String name, int value)
public void writeFieldValue(char seperator, String name, long value)
public void writeFieldValue1(char seperator, String name, long value)
public void writeFieldValue(char seperator, String name, float value)
public void writeFieldValue(char seperator, String name, double value)
public void writeFieldValue(char seperator, String name, String value)
public void writeFieldValue(char seperator, String name, Enum<?> value)
public void writeFieldValue(char seperator, String name, BigDecimal value)
public void writeString(String text, char seperator)
public void writeString(String text)
public void writeFieldName(String key)
public void writeFieldName(String key, boolean checkSpecial)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |