ResourceStream

Qualified name: delphivcl.ResourceStream

class ResourceStream

Bases: CustomMemoryStream

TResourceStream is a memory stream that provides access to the compiled resources in an application. Use TResourceStream to read the resources of an application. An instance of TResourceStream holds the value of a single resource in a memory buffer where it is accessible to the application. The global ReadComponentRes function uses TResourceStream to access the compiled resources used by the application.

Methods

ReadBytes

Read content as bytes.

ReadFloat

Read content as float.

ReadInt

Read content as integer.

ReadString

Read content as string.

Write

Overrides the inherited method to raise an exception when an attempt is made to write the resource back to the application.

WriteBytes

Write content as bytes.

WriteFloat

Write content as float.

WriteInt

Write content as integer.

WriteString

Write content as string.

Attributes

Capabilities

StreamCapabilities:

ClassName

Returns the TObject.ClassName

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

ReadBytes()

Read content as bytes.

ReadFloat()

Read content as float.

ReadInt()

Read content as integer.

ReadString()

Read content as string.

Write(Buffer, Count: int) int

Overrides the inherited method to raise an exception when an attempt is made to write the resource back to the application. Applications should not use a TResourceStream to write the resources of the running application. Write overrides the inherited method to raise an EStreamError exception when an application tries to write to the application’s resources. As all other data-writing methods of TResourceStream (WriteBuffer, WriteComponent) call Write to do the actual writing, calling any of the data-writing methods of TResourceStream will raise an exception.

WriteBytes()

Write content as bytes.

WriteFloat()

Write content as float.

WriteInt()

Write content as integer.

WriteString()

Write content as string.