StringBuilderWriter

org.beangle.commons.io.StringBuilderWriter
class StringBuilderWriter(val builder: StringBuilder) extends Writer, Serializable

[[Writer]] implementation that outputs to a [[StringBuilder]].

NOTE: This implementation, as an alternative to java.io.StringWriter, provides an un-synchronized (i.e. for use in a single thread) implementation for better performance. For safe usage with multiple [[Thread]]s then java.io.StringWriter should be used.

Attributes

Since

3.1

Graph
Supertypes
trait Serializable
class Writer
trait Flushable
trait Closeable
trait AutoCloseable
trait Appendable
class Object
trait Matchable
class Any
Show all

Members list

Value members

Constructors

def this(capacity: Int)

Construct a new [[StringBuilder]] instance with the specified capacity.

Construct a new [[StringBuilder]] instance with the specified capacity.

Value parameters

capacity

The initial capacity of the underlying { @link StringBuilder}

Attributes

Concrete methods

override def append(value: Char): Writer

Append a single character to this Writer.

Append a single character to this Writer.

Attributes

Definition Classes
Writer -> Appendable
override def append(value: CharSequence): Writer

Append a character sequence to this Writer.

Append a character sequence to this Writer.

Attributes

Definition Classes
Writer -> Appendable
override def append(value: CharSequence, start: Int, end: Int): Writer

Append a portion of a character sequence to the [[StringBuilder]].

Append a portion of a character sequence to the [[StringBuilder]].

Attributes

Definition Classes
Writer -> Appendable
override def close(): Unit

Closing this writer has no effect.

Closing this writer has no effect.

Attributes

Definition Classes
Writer -> Closeable -> AutoCloseable
override def flush(): Unit

Flushing this writer has no effect.

Flushing this writer has no effect.

Attributes

Definition Classes
Writer -> Flushable
override def toString: String

Returns [[StringBuilder# toString ( )]].

Returns [[StringBuilder# toString ( )]].

Attributes

Definition Classes
Any
override def write(value: String): Unit

Write a String to the [[StringBuilder]].

Write a String to the [[StringBuilder]].

Value parameters

value

The value to write

Attributes

Definition Classes
Writer
override def write(value: Array[Char], offset: Int, length: Int): Unit

Write a portion of a character array to the [[StringBuilder]].

Write a portion of a character array to the [[StringBuilder]].

Attributes

Definition Classes
Writer

Inherited methods

def write(x$0: String, x$1: Int, x$2: Int): Unit

Attributes

Inherited from:
Writer
def write(x$0: Array[Char]): Unit

Attributes

Inherited from:
Writer
def write(x$0: Int): Unit

Attributes

Inherited from:
Writer

Concrete fields

val builder: StringBuilder