public final class StringWriter extends Writer
StringBuilder. Not like java.io.StringWriter. it's not multi-thread safety.| Constructor and Description |
|---|
StringWriter() |
StringWriter(int initialSize) |
StringWriter(StringBuilder sb) |
| Modifier and Type | Method and Description |
|---|---|
StringWriter |
append(char c) |
StringWriter |
append(CharSequence csq) |
StringWriter |
append(CharSequence csq,
int start,
int end) |
void |
close() |
void |
flush()
Flush.
|
StringBuilder |
stringBuilder() |
String |
toString()
Return the buffer's current value as a string.
|
void |
write(char[] cbuf,
int off,
int len) |
void |
write(int c) |
void |
write(String str) |
void |
write(String str,
int off,
int len) |
public StringWriter()
public StringWriter(int initialSize)
public StringWriter(StringBuilder sb)
public StringBuilder stringBuilder()
public void write(char[] cbuf,
int off,
int len)
public void write(String str, int off, int len)
public StringWriter append(CharSequence csq) throws IOException
append in interface Appendableappend in class Writercsq - IOException - Signals that an I/O exception has occurred.public StringWriter append(CharSequence csq, int start, int end) throws IOException
append in interface Appendableappend in class Writercsq - start - end - IOException - Signals that an I/O exception has occurred.public StringWriter append(char c)
append in interface Appendableappend in class Writerc - public String toString()
public void flush()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOException - Signals that an I/O exception has occurred.Copyright © 2021. All rights reserved.