Top Description Fields Constructors Methods
com.sun.faces.io

public Class FastStringWriter

extends Writer
Class Inheritance
Imports
java.io.IOException, .Writer

This is based on java.io.StringWriter but backed by a StringBuilder instead.

This class is not thread safe.

Field Summary

Modifier and TypeField and Description
protected StringBuilder
Inherited from java.io.Writer:
lock

Constructor Summary

AccessConstructor and Description
public
FastStringWriter()

Constructs a new FastStringWriter instance using the default capacity of 16.

public
FastStringWriter(int
specifies the initial capacity of the buffer
initialCapacity
)

Constructs a new FastStringWriter instance using the specified initialCapacity.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract java.io.Writer.close.

Implements java.io.Closeable.close.

This is a no-op.

public void
flush()

Implements abstract java.io.Writer.flush.

Implements java.io.Flushable.flush.

This is a no-op.

public StringBuilder

Returns:

StringBuilder holding the current buffer value.
getBuffer
()

Return the StringBuilder itself.

public void
public String

Returns:

the buffer's current value as a string.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
write(char[]
Array of characters
cbuf
,
int
Offset from which to start writing characters
off
,
int
Number of characters to write
len
)

Implements abstract java.io.Writer.write.

Write a portion of an array of characters.

public void
write(String
String to be written
str
)

Overrides java.io.Writer.write.

Write a string.
public void
write(String
A String
str
,
int
Offset from which to start writing characters
off
,
int
Number of characters to write
len
)

Overrides java.io.Writer.write.

Write a portion of a string.
Inherited from java.io.Writer:
appendappendappendnullWriterwritewrite

Field Detail

builderback to summary
protected StringBuilder builder

Constructor Detail

FastStringWriterback to summary
public FastStringWriter()

Constructs a new FastStringWriter instance using the default capacity of 16.

FastStringWriterback to summary
public FastStringWriter(int initialCapacity)

Constructs a new FastStringWriter instance using the specified initialCapacity.

Parameters
initialCapacity:int

specifies the initial capacity of the buffer

Exceptions
IllegalArgumentException:
if initialCapacity is less than zero

Method Detail

closeback to summary
public void close() throws IOException

Implements abstract java.io.Writer.close.

Implements java.io.Closeable.close.

This is a no-op.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Writer.close.

If an I/O error occurs

flushback to summary
public void flush() throws IOException

Implements abstract java.io.Writer.flush.

Implements java.io.Flushable.flush.

This is a no-op.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Writer.flush.

If an I/O error occurs

getBufferback to summary
public StringBuilder getBuffer()

Return the StringBuilder itself.

Returns:StringBuilder

StringBuilder holding the current buffer value.

resetback to summary
public void reset()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

the buffer's current value as a string.

Annotations
@Override
writeback to summary
public void write(char[] cbuf, int off, int len) throws IOException

Implements abstract java.io.Writer.write.

Write a portion of an array of characters.

Parameters
cbuf:char[]

Array of characters

off:int

Offset from which to start writing characters

len:int

Number of characters to write

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Writer.write.

If an I/O error occurs

writeback to summary
public void write(String str)

Overrides java.io.Writer.write.

Write a string.

Parameters
str:String

String to be written

Annotations
@Override
writeback to summary
public void write(String str, int off, int len)

Overrides java.io.Writer.write.

Write a portion of a string.

Parameters
str:String

A String

off:int

Offset from which to start writing characters

len:int

Number of characters to write

Annotations
@Override