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.Appendableappend in class java.io.Writerpublic java.io.Writer append(java.lang.CharSequence csq)
append in interface java.lang.Appendableappend in class java.io.Writerpublic java.io.Writer append(java.lang.CharSequence csq,
int start,
int end)
append in interface java.lang.Appendableappend in class java.io.Writerpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Writerpublic void flush()
flush in interface java.io.Flushableflush in class java.io.Writerpublic void write(char[] cbuf)
write in class java.io.Writerpublic void write(char[] cbuf,
int off,
int len)
write in class java.io.Writerpublic void write(int c)
write in class java.io.Writerpublic void write(java.lang.String str)
write in class java.io.Writerpublic void write(java.lang.String str,
int off,
int len)
write in class java.io.Writerpublic java.lang.String getAndClear()
Copyright © 2010 - 2023 Adobe. All Rights Reserved