|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Writer
org.torweg.pulse.util.io.FastStringWriter
public final class FastStringWriter
A not thread-safe replacement for StringWriter
which internally uses a StringBuilder as the buffer.
FastByteArrayOutputStream| Field Summary |
|---|
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
FastStringWriter()
creates a new FastStringWriter, using the default initial
size for the underlying StringBuilder. |
|
FastStringWriter(int size)
creates a new FastStringWriter, using the specified initial
size for the underlying StringBuilder. |
|
FastStringWriter(int size,
java.io.Writer target)
creates a new FastStringWriter, using the specified initial
size for the underlying StringBuilder writing through to the
given Writer. |
|
FastStringWriter(java.io.Writer target)
creates a new FastStringWriter, using the default initial
size for the underlying StringBuilder writing through to the
given Writer. |
|
| Method Summary | |
|---|---|
void |
close()
closes the optional write-through Writer. |
void |
flush()
flushes the optional write-through Writer. |
java.lang.StringBuilder |
getStringBuilder()
returns the underlying StringBuilder. |
java.lang.String |
toString()
returns the contents of the Writer as a String. |
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)
|
| Methods inherited from class java.io.Writer |
|---|
append, append, append, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FastStringWriter()
FastStringWriter, using the default initial
size for the underlying StringBuilder.
public FastStringWriter(java.io.Writer target)
FastStringWriter, using the default initial
size for the underlying StringBuilder writing through to the
given Writer.
target - the writer to write throughpublic FastStringWriter(int size)
FastStringWriter, using the specified initial
size for the underlying StringBuilder.
size - the initial size for the StringBuilder.
public FastStringWriter(int size,
java.io.Writer target)
FastStringWriter, using the specified initial
size for the underlying StringBuilder writing through to the
given Writer.
size - the initial size for the StringBuilder.target - the writer to write through| Method Detail |
|---|
public void write(int c)
write in class java.io.WriterWriteThroughException - on I/O errors in the optional write-through
Writer
public void write(char[] cbuf,
int off,
int len)
write in class java.io.WriterWriteThroughException - on I/O errors in the optional write-through
Writerpublic void write(java.lang.String str)
write in class java.io.WriterWriteThroughException - on I/O errors in the optional write-through
Writer
public void write(java.lang.String str,
int off,
int len)
write in class java.io.WriterWriteThroughException - on I/O errors in the optional write-through
Writerpublic java.lang.String toString()
Writer as a String.
toString in class java.lang.Objectpublic java.lang.StringBuilder getStringBuilder()
StringBuilder.
StringBuilderpublic void flush()
Writer.
flush in interface java.io.Flushableflush in class java.io.WriterWriteThroughException - on I/O errors in the optional write-through
Writerpublic void close()
Writer.
close in interface java.io.Closeableclose in class java.io.WriterWriteThroughException - on I/O errors in the optional write-through
Writer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||