public class FastStringWriter extends Writer
1. 去掉了锁 2. 初始容量由 32 改为 64 3. null 直接返回,不写入
| Constructor and Description |
|---|
FastStringWriter()
Creates a new CharArrayWriter.
|
FastStringWriter(int initialSize)
Creates a new CharArrayWriter with the specified initial size.
|
| Modifier and Type | Method and Description |
|---|---|
FastStringWriter |
append(char c) |
FastStringWriter |
append(CharSequence csq) |
FastStringWriter |
append(CharSequence csq,
int start,
int end) |
void |
close() |
void |
flush() |
String |
toString() |
void |
write(char[] c,
int off,
int len) |
void |
write(int c) |
void |
write(String str) |
void |
write(String str,
int off,
int len) |
public FastStringWriter()
public FastStringWriter(int initialSize)
initialSize - an int specifying the initial buffer size.IllegalArgumentException - if initialSize is negativepublic FastStringWriter append(@Nullable CharSequence csq)
append in interface Appendableappend in class Writerpublic FastStringWriter append(@Nullable CharSequence csq, int start, int end)
append in interface Appendableappend in class Writerpublic FastStringWriter append(char c)
append in interface Appendableappend in class Writerpublic void flush()
Copyright © 2024. All rights reserved.