MemoryTextStream

Description

sealed class Tinman.Core.IO.Streams.MemoryTextStream

Derived from

TextStreamBase abstract

An implementation of the ITextStream that uses a growing memory buffer.

Public / Constructors

For

4 overloads


[OwnerReturn]
public static method For1 → (1)

chars in : string

[not-null]
The text to read. The data is copied.

returns → MemoryTextStream

The created text stream.

Creates a new instance of MemoryTextStream that reads the given text.

The stream will be in read mode.


[OwnerReturn]
public static method For2 → (1)

chars in : char [ ]

[not-null]
The text to read. The data is copied.

returns → MemoryTextStream

The created text stream.

Creates a new instance of MemoryTextStream that reads the given text.

The stream will be in read mode.


[OwnerReturn]
public static method For3 → (3)

chars in : string

[not-null]
The text to read. The data is copied.

offset in : int32

[>=0]
Offset into chars in to first character to read.

count in : int32

[>=0]
Total number of characters to read.

returns → MemoryTextStream

The created text stream.

Creates a new instance of MemoryTextStream that reads the given text.

The stream will be in read mode.


[OwnerReturn]
public static method For4 → (3)

chars in : char [ ]

[not-null]
The text to read. The data is copied.

offset in : int32

[>=0]
Offset into chars in to first character to read.

count in : int32

[>=0]
Total number of characters to read.

returns → MemoryTextStream

The created text stream.

Creates a new instance of MemoryTextStream that reads the given text.

The stream will be in read mode.

Memory​Text​Stream


public constructor MemoryTextStream → (1)

initialCapacity opt : int64 = 1024

[>=0]
The initial buffer size, in characters.

Creates a new instance of MemoryTextStream.

The stream will be in write mode.

Public / Methods

Flip


public method Flip → ()

returns → MemoryTextStream

this

Flips this memory stream so that it reads back the data that has been written to it.

When calling this method, the stream must be in write mode. After returning, the stream will be in read mode.

IOException

If the memory stream is not in write mode.

See also

object.ToString