Skip to content

TBufStream.Create

Create a new TBufStream instance.

Declaration

Source position: bufstream.pp line 57

public 
constructor Create(ASource: TStream; ACapacity: Integer);

constructor Create(ASource: TStream);

Description

Create creates a new TBufStream instance. A buffer of size ACapacity is allocated, and the ASource source (or destination) stream is stored. If no capacity is specified, then DefaultBufferCapacity is used as the capacity.

An instance of TBufStream should never be instantiated directly. Instead, an instance of TReadBufStream or TWriteBufStream should be created.

Errors

If not enough memory is available for the buffer, then an exception may be raised.

See also

Name Description
TBufStream.Destroy Destroys the TBufStream instance.
TReadBufStream Read-only buffered stream.
TWriteBufStream Write-only buffered stream.