public final class SegmentedStringWriter
extends java.io.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
.
Constructor and Description |
---|
SegmentedStringWriter(BufferRecycler br) |
Modifier and Type | Method and Description |
---|---|
java.io.Writer |
append(char c) |
java.io.Writer |
append(java.lang.CharSequence csq) |
java.io.Writer |
append(java.lang.CharSequence csq,
int start,
int end) |
void |
close() |
void |
flush() |
java.lang.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(java.lang.String str) |
void |
write(java.lang.String str,
int off,
int len) |
public SegmentedStringWriter(BufferRecycler br)
public java.io.Writer append(char c)
append
in interface java.lang.Appendable
append
in class java.io.Writer
public java.io.Writer append(java.lang.CharSequence csq)
append
in interface java.lang.Appendable
append
in class java.io.Writer
public java.io.Writer append(java.lang.CharSequence csq, int start, int end)
append
in interface java.lang.Appendable
append
in class java.io.Writer
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Writer
public void flush()
flush
in interface java.io.Flushable
flush
in class java.io.Writer
public void write(char[] cbuf)
write
in class java.io.Writer
public void write(char[] cbuf, int off, int len)
write
in class java.io.Writer
public void write(int c)
write
in class java.io.Writer
public void write(java.lang.String str)
write
in class java.io.Writer
public void write(java.lang.String str, int off, int len)
write
in class java.io.Writer
public java.lang.String getAndClear()
Copyright © 2010 - 2020 Adobe. All Rights Reserved