TROBinaryMemoryStream

Overview

The TROBinaryMemoryStream (or short Binary) class builds upon the standard memory stream provided by the Delphi VCL to extend it with additional methods that make it easier to use.

This class forms the basis for passing unstructured binary data between clients and servers, and will be used whenever you declare "Binary" types in your RODL files.

Location


 

constructor Create  overload

Creates a new instance.

constructor Create

constructor Create (AnsiString)  overload

Creates a new instance from given string.

constructor Create(const Value: AnsiString)

Parameters:

  • Value: given string

constructor Create (ROAnsiString)  overload

Creates a new instance from given string.

constructor Create(const Value: ROAnsiString)

Parameters:

  • Value: given string

Assign  virtual

Creates a new instance from given string.

procedure Assign(Source: TStream)

Parameters:

  • Source: given string

CapacityIncrement

The amount by which the capacity of the stream is automatically incremented when its size becomes greater than its capacity.

property CapacityIncrement: Integer read write

Clone

Creates and returns a new memory stream that is an identical copy of the current stream. The new stream will receive its own copy of the data, and any changes to data or stream position will not affect the original version.

function Clone: TROBinaryMemoryStream

LoadFromHexString

Creates a new instance from given string.

procedure LoadFromHexString(const Value: ROAnsiString)

Parameters:

  • Value: given string

LoadFromString (AnsiString)  overload

Creates a new instance from given string.

procedure LoadFromString(const Value: AnsiString)

Parameters:

  • Value: given string

LoadFromString (ROAnsiString)  overload

Creates a new instance from given string.

procedure LoadFromString(const Value: ROAnsiString)

Parameters:

  • Value: given string

LoadFromUTF8String

Creates a new instance from given string.

procedure LoadFromUTF8String(const Value: UnicodeString)

Parameters:

  • Value: given string

ToHexString

Emits the data in the stream as a string containing hexadecimal characters. For each byte in the original stream, two characters between '0' and 'F' will be emitted to the string.

function ToHexString: ROAnsiString

ToReadableString

Emits the data in the stream as an ansi string for display purposes. For each byte in the original stream, the corresponding ASCII character will be emitted to the string if the value is $0D or between $20 and $7F, and a "period" character will be emitted otherwise. This results in a string that can cleanly be displayed and does not contain ASCII control characters.

function ToReadableString: ROAnsiString

ToString

Emits the data in the stream as an ansi string. For each byte in the original stream, the corresponding ANSI character will be emitted to the string.

function ToString: ROAnsiString

WriteAnsiString

Creates a new instance from given string.

function WriteAnsiString(const Value: ROAnsiString): Integer

Parameters:

  • Value: given string

 

CapacityIncrement

The amount by which the capacity of the stream is automatically incremented when its size becomes greater than its capacity.

property CapacityIncrement: Integer read write

 

constructor Create  overload

Creates a new instance.

constructor Create

constructor Create (AnsiString)  overload

Creates a new instance from given string.

constructor Create(const Value: AnsiString)

Parameters:

  • Value: given string

constructor Create (ROAnsiString)  overload

Creates a new instance from given string.

constructor Create(const Value: ROAnsiString)

Parameters:

  • Value: given string

Assign  virtual

Creates a new instance from given string.

procedure Assign(Source: TStream)

Parameters:

  • Source: given string

Clone

Creates and returns a new memory stream that is an identical copy of the current stream. The new stream will receive its own copy of the data, and any changes to data or stream position will not affect the original version.

function Clone: TROBinaryMemoryStream

LoadFromHexString

Creates a new instance from given string.

procedure LoadFromHexString(const Value: ROAnsiString)

Parameters:

  • Value: given string

LoadFromString (AnsiString)  overload

Creates a new instance from given string.

procedure LoadFromString(const Value: AnsiString)

Parameters:

  • Value: given string

LoadFromString (ROAnsiString)  overload

Creates a new instance from given string.

procedure LoadFromString(const Value: ROAnsiString)

Parameters:

  • Value: given string

LoadFromUTF8String

Creates a new instance from given string.

procedure LoadFromUTF8String(const Value: UnicodeString)

Parameters:

  • Value: given string

ToHexString

Emits the data in the stream as a string containing hexadecimal characters. For each byte in the original stream, two characters between '0' and 'F' will be emitted to the string.

function ToHexString: ROAnsiString

ToReadableString

Emits the data in the stream as an ansi string for display purposes. For each byte in the original stream, the corresponding ASCII character will be emitted to the string if the value is $0D or between $20 and $7F, and a "period" character will be emitted otherwise. This results in a string that can cleanly be displayed and does not contain ASCII control characters.

function ToReadableString: ROAnsiString

ToString

Emits the data in the stream as an ansi string. For each byte in the original stream, the corresponding ANSI character will be emitted to the string.

function ToString: ROAnsiString

WriteAnsiString

Creates a new instance from given string.

function WriteAnsiString(const Value: ROAnsiString): Integer

Parameters:

  • Value: given string