The constructor creates the buffer metastream and prepares the stream for reading or writing.
Namespace: GStreams
Delphi
|
public
constructor Create(Stream: TStream); virtual;
|
Parameters
Stream
Type: TStream
The following code shows how to use the TGBufferStream class to buffer the file i/o:
Delphi
|
var
FileStream: TFileStream;
Stream: TGBufferStream;
begin
FileStream := TFileStream.Create( FileName, fmOpenRead );
try
Stream := TGBufferStream.Create( FileStream );
try
// Lots of buffer reads here
finally
Stream.Free;
end;
finally
FileStream.Free;
end;
end;
|
|