StringBuilderWriter

@SerialVersionUID(1L)
class StringBuilderWriter(val builder: StringBuilder) extends Writer with 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.

Since:

3.1

trait Serializable
class Writer
trait Flushable
trait Closeable
trait AutoCloseable
trait Appendable
class Object
trait Matchable
class Any

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}

Concrete methods

override def append(value: Char): Writer

Append a single character to this Writer.

Append a single character to this Writer.

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

Append a character sequence to this Writer.

Append a character sequence to this Writer.

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]].

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

Closing this writer has no effect.

Closing this writer has no effect.

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

Flushing this writer has no effect.

Flushing this writer has no effect.

Definition Classes
Writer -> Flushable
override def toString: String

Returns [[StringBuilder#toString()]].

Returns [[StringBuilder#toString()]].

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

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]].

Definition Classes
Writer

Inherited methods

@throws(java.io.IOException)
def write(x$0: String, x$1: Int, x$2: Int): Unit
Inherited from:
Writer
@throws(java.io.IOException)
def write(x$0: Array[Char]): Unit
Inherited from:
Writer
@throws(java.io.IOException)
def write(x$0: Int): Unit
Inherited from:
Writer

Concrete fields

val builder: StringBuilder