public final class SegmentedStringWriter extends Writer
StringWriter
, based on using segmented
internal buffer. Initial input buffer is also recyclable.
This class is most useful when serializing JSON content as a String:
if so, instance of this class can be given as the writer to
JsonGenerator
.
限定符和类型 | 字段和说明 |
---|---|
protected TextBuffer |
_buffer |
构造器和说明 |
---|
SegmentedStringWriter(BufferRecycler br) |
限定符和类型 | 方法和说明 |
---|---|
Writer |
append(char c) |
Writer |
append(CharSequence csq) |
Writer |
append(CharSequence csq,
int start,
int end) |
void |
close() |
void |
flush() |
String |
getAndClear()
Main access method that will construct a String that contains
all the contents, release all internal buffers we may have,
and return result String.
|
void |
write(char[] cbuf) |
void |
write(char[] cbuf,
int off,
int len) |
void |
write(int c) |
void |
write(String str) |
void |
write(String str,
int off,
int len) |
protected final TextBuffer _buffer
public SegmentedStringWriter(BufferRecycler br)
public Writer append(char c)
append
在接口中 Appendable
append
在类中 Writer
public Writer append(CharSequence csq)
append
在接口中 Appendable
append
在类中 Writer
public Writer append(CharSequence csq, int start, int end)
append
在接口中 Appendable
append
在类中 Writer
public void close()
public String getAndClear()