com.alibaba.fastjson.serializer
类 SerializeWriter

java.lang.Object
  继承者 java.io.Writer
      继承者 com.alibaba.fastjson.serializer.SerializeWriter
所有已实现的接口:
Closeable, Flushable, Appendable

public final class SerializeWriter
extends Writer

作者:
wenshao

构造方法摘要
SerializeWriter()
           
SerializeWriter(int initialSize)
           
SerializeWriter(SerializerFeature... features)
           
SerializeWriter(Writer writer)
           
SerializeWriter(Writer writer, int initialSize)
           
SerializeWriter(Writer writer, SerializerFeature... features)
           
 
方法摘要
 SerializeWriter append(char c)
           
 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()
           
 int getBufferLength()
           
 boolean isEnabled(SerializerFeature feature)
           
 void reset()
           
 int size()
           
 byte[] toBytes(String charsetName)
           
 char[] toCharArray()
          Returns a copy of the input data.
 String toString()
           
 void write(boolean value)
           
 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 writeBooleanAndChar(boolean value, char c)
           
 void writeByteArray(byte[] bytes)
           
 void writeCharacterAndChar(char value, char c)
           
 void writeDoubleAndChar(double value, char c)
           
 void writeEnum(Enum<?> value, char c)
           
 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, int value)
           
 void writeFieldValue1(char seperator, String name, long value)
           
 void writeFloatAndChar(float value, char c)
           
 void writeInt(int i)
           
 void writeIntAndChar(int i, char c)
           
 void writeLong(long i)
           
 void writeLongAndChar(long i, char c)
           
 void writeNull()
           
 void writeString(String text)
           
 void writeString(String text, char seperator)
           
 void writeTo(OutputStream out, Charset charset)
           
 void writeTo(OutputStream out, String charsetName)
           
 void writeTo(Writer out)
          Writes the contents of the buffer to another character stream.
 
从类 java.io.Writer 继承的方法
write
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

SerializeWriter

public SerializeWriter()

SerializeWriter

public SerializeWriter(Writer writer)

SerializeWriter

public SerializeWriter(SerializerFeature... features)

SerializeWriter

public SerializeWriter(Writer writer,
                       SerializerFeature... features)

SerializeWriter

public SerializeWriter(int initialSize)

SerializeWriter

public SerializeWriter(Writer writer,
                       int initialSize)
方法详细信息

getBufferLength

public int getBufferLength()

config

public void config(SerializerFeature feature,
                   boolean state)

isEnabled

public boolean isEnabled(SerializerFeature feature)

write

public void write(int c)
Writes a character to the buffer.

覆盖:
Writer 中的 write

write

public void write(char c)

write

public void write(char[] c,
                  int off,
                  int len)
Writes characters to the buffer.

指定者:
Writer 中的 write
参数:
c - the data to be written
off - the start offset in the data
len - the number of chars that are written

expandCapacity

public void expandCapacity(int minimumCapacity)

write

public void write(String str,
                  int off,
                  int len)
Write a portion of a string to the buffer.

覆盖:
Writer 中的 write
参数:
str - String to be written from
off - Offset from which to start reading characters
len - Number of characters to be written

writeTo

public void writeTo(Writer out)
             throws IOException
Writes the contents of the buffer to another character stream.

参数:
out - the output stream to write to
抛出:
IOException - If an I/O error occurs.

writeTo

public void writeTo(OutputStream out,
                    String charsetName)
             throws IOException
抛出:
IOException

writeTo

public void writeTo(OutputStream out,
                    Charset charset)
             throws IOException
抛出:
IOException

append

public SerializeWriter append(CharSequence csq)
指定者:
接口 Appendable 中的 append
覆盖:
Writer 中的 append

append

public SerializeWriter append(CharSequence csq,
                              int start,
                              int end)
指定者:
接口 Appendable 中的 append
覆盖:
Writer 中的 append

append

public SerializeWriter append(char c)
指定者:
接口 Appendable 中的 append
覆盖:
Writer 中的 append

reset

public void reset()

toCharArray

public char[] toCharArray()
Returns a copy of the input data.

返回:
an array of chars copied from the input data.

toBytes

public byte[] toBytes(String charsetName)

size

public int size()

toString

public String toString()
覆盖:
Object 中的 toString

close

public void close()
Close the stream. This method does not release the buffer, since its contents might still be required. Note: Invoking this method in this class will have no effect.

指定者:
接口 Closeable 中的 close
指定者:
Writer 中的 close

write

public void write(String text)
覆盖:
Writer 中的 write

writeInt

public void writeInt(int i)

writeByteArray

public void writeByteArray(byte[] bytes)

writeFloatAndChar

public void writeFloatAndChar(float value,
                              char c)

writeDoubleAndChar

public void writeDoubleAndChar(double value,
                               char c)

writeBooleanAndChar

public void writeBooleanAndChar(boolean value,
                                char c)

writeCharacterAndChar

public void writeCharacterAndChar(char value,
                                  char c)

writeEnum

public void writeEnum(Enum<?> value,
                      char c)

writeIntAndChar

public void writeIntAndChar(int i,
                            char c)

writeLongAndChar

public void writeLongAndChar(long i,
                             char c)
                      throws IOException
抛出:
IOException

writeLong

public void writeLong(long i)

writeNull

public void writeNull()

writeFieldNull

public void writeFieldNull(char seperator,
                           String name)

writeFieldEmptyList

public void writeFieldEmptyList(char seperator,
                                String key)

writeFieldNullString

public void writeFieldNullString(char seperator,
                                 String name)

writeFieldNullBoolean

public void writeFieldNullBoolean(char seperator,
                                  String name)

writeFieldNullList

public void writeFieldNullList(char seperator,
                               String name)

writeFieldNullNumber

public void writeFieldNullNumber(char seperator,
                                 String name)

writeFieldValue

public void writeFieldValue(char seperator,
                            String name,
                            char value)

writeFieldValue

public void writeFieldValue(char seperator,
                            String name,
                            boolean value)

write

public void write(boolean value)

writeFieldValue

public void writeFieldValue(char seperator,
                            String name,
                            int value)

writeFieldValue1

public void writeFieldValue1(char seperator,
                             String name,
                             int value)

writeFieldValue

public void writeFieldValue(char seperator,
                            String name,
                            long value)

writeFieldValue1

public void writeFieldValue1(char seperator,
                             String name,
                             long value)

writeFieldValue

public void writeFieldValue(char seperator,
                            String name,
                            float value)

writeFieldValue

public void writeFieldValue(char seperator,
                            String name,
                            double value)

writeFieldValue

public void writeFieldValue(char seperator,
                            String name,
                            String value)

writeFieldValue

public void writeFieldValue(char seperator,
                            String name,
                            Enum<?> value)

writeFieldValue

public void writeFieldValue(char seperator,
                            String name,
                            BigDecimal value)

writeString

public void writeString(String text,
                        char seperator)

writeString

public void writeString(String text)

writeFieldName

public void writeFieldName(String key)

writeFieldName

public void writeFieldName(String key,
                           boolean checkSpecial)

flush

public void flush()
指定者:
接口 Flushable 中的 flush
指定者:
Writer 中的 flush


Copyright © 2012-2014 Alibaba Group. All Rights Reserved.