|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.Writer
com.sun.faces.io.FastStringWriter
public class FastStringWriter
This is based on StringWriter but backed by a
StringBuilder instead.
This class is not thread safe.
| Field Summary | |
|---|---|
protected java.lang.StringBuilder |
builder
|
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
FastStringWriter()
Constructs a new FastStringWriter instance
using the default capacity of 16. |
|
FastStringWriter(int initialCapacity)
Constructs a new FastStringWriter instance
using the specified initialCapacity. |
|
| Method Summary | |
|---|---|
void |
close()
This is a no-op. |
void |
flush()
This is a no-op. |
java.lang.StringBuilder |
getBuffer()
Return the StringBuilder itself. |
void |
reset()
|
java.lang.String |
toString()
|
void |
write(char[] cbuf,
int off,
int len)
Write a portion of an array of characters. |
void |
write(java.lang.String str)
Write a string. |
void |
write(java.lang.String str,
int off,
int len)
Write a portion of a string. |
| Methods inherited from class java.io.Writer |
|---|
append, append, append, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.StringBuilder builder
| Constructor Detail |
|---|
public FastStringWriter()
Constructs a new FastStringWriter instance
using the default capacity of 16.
public FastStringWriter(int initialCapacity)
Constructs a new FastStringWriter instance
using the specified initialCapacity.
initialCapacity - specifies the initial capacity of the buffer
java.lang.IllegalArgumentException - if initialCapacity is less than zero| Method Detail |
|---|
public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
Write a portion of an array of characters.
write in class java.io.Writercbuf - Array of charactersoff - Offset from which to start writing characterslen - Number of characters to write
java.io.IOException
public void flush()
throws java.io.IOException
This is a no-op.
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOException
public void close()
throws java.io.IOException
This is a no-op.
close in interface java.io.Closeableclose in class java.io.Writerjava.io.IOExceptionpublic void write(java.lang.String str)
write in class java.io.Writerstr - String to be written
public void write(java.lang.String str,
int off,
int len)
write in class java.io.Writerstr - A Stringoff - Offset from which to start writing characterslen - Number of characters to writepublic java.lang.StringBuilder getBuffer()
StringBuilder itself.
public java.lang.String toString()
toString in class java.lang.Objectpublic void reset()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||