StringStream

Qualified name: delphivcl.StringStream

class StringStream

Bases: BytesStream

TStringStream provides file-like access to information stored as a long string. Use TStringStream to store data as a long string enhanced with I/O capabilities. TStringStream is useful as an intermediary object that can hold text as well as read it from or write it to another storage medium. TStringStream provides a mechanism for manipulating text that is obtained from a less accessible medium.

Methods

ReadBytes

Read content as bytes.

ReadFloat

Read content as float.

ReadInt

Read content as integer.

ReadString

Read content as string.

WriteBytes

Write content as bytes.

WriteFloat

Write content as float.

WriteInt

Write content as integer.

WriteString

Write content as string.

Attributes

Bytes

Specifies the stored data.

Capabilities

StreamCapabilities:

ClassName

Returns the TObject.ClassName

DataString

Provides direct access to the string that stores the text represented by the TStringStream object.

Encoding

Represents the encoding used internally by the TStringStream instance to store the data.

Memory

Provides direct access to the memory pool allocated for the memory stream.

Position

Indicates the current offset into the stream for reading and writing.

Size

Indicates the size in bytes of the stream.

ClassName

Returns the TObject.ClassName

DataString

Provides direct access to the string that stores the text represented by the TStringStream object. Use DataString to get access to the text of the stream. The text represents the information that is being transferred by means of the string stream. Size is the number of bytes in the string, and Position is the current position within DataString.

Note: DataString is a read-only property. DataString can be used to change the contents of the string, but applications can’t change the DataString itself.

Type:

str

Encoding

Represents the encoding used internally by the TStringStream instance to store the data. Encoding represents the encoding that is used to get the corresponding array of bytes from a given string, or to obtain the corresponding string from the contained array of bytes. (A string stream contains an array of bytes.) The encoding of a stream string is set in the constructor (you can specify what encoding to use).

Type:

Encoding

ReadBytes()

Read content as bytes.

ReadFloat()

Read content as float.

ReadInt()

Read content as integer.

ReadString()

Read content as string.

WriteBytes()

Write content as bytes.

WriteFloat()

Write content as float.

WriteInt()

Write content as integer.

WriteString()

Write content as string.