java.lang.Object
java.io.Writer
com.sun.faces.io.FastStringWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
This is based on StringWriter but backed by a StringBuilder instead.
This class is not thread safe.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newFastStringWriterinstance using the default capacity of16.FastStringWriter(int initialCapacity) Constructs a newFastStringWriterinstance using the specifiedinitialCapacity. -
Method Summary
-
Field Details
-
builder
-
-
Constructor Details
-
FastStringWriter
public FastStringWriter()Constructs a new
FastStringWriterinstance using the default capacity of16. -
FastStringWriter
public FastStringWriter(int initialCapacity) Constructs a new
FastStringWriterinstance using the specifiedinitialCapacity.- Parameters:
initialCapacity- specifies the initial capacity of the buffer- Throws:
IllegalArgumentException- if initialCapacity is less than zero
-
-
Method Details
-
write
Write a portion of an array of characters.
- Specified by:
writein classWriter- Parameters:
cbuf- Array of charactersoff- Offset from which to start writing characterslen- Number of characters to write- Throws:
IOException
-
flush
This is a no-op.
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
This is a no-op.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
write
-
write
-
getBuffer
Return theStringBuilderitself.- Returns:
- StringBuilder holding the current buffer value.
-
toString
-
reset
public void reset()
-