Sign in Join
FPDoc Onlineexperiment

TBufStream object

In unit Objects

Buffered file stream.

Declaration

pascal
TBufStream = class(TDosStream)

Inheritance

  1. TBufStream
  2. TDosStream
  3. TStream
  4. TObject

Descends from it: TReadBufStream TWriteBufStream

Description

Bufstream implements a buffered file stream. That is, all data written to the stream is written to memory first. Only when the buffer is full, or on explicit request, the data is written to disk.

Also, when reading from the stream, first the buffer is checked if there is any unread data in it. If so, this is read first. If not the buffer is filled again, and then the data is read from the buffer.

The size of the buffer is fixed and is set when constructing the file.

This is useful if you need heavy throughput for your stream, because it speeds up operations.

Methods

InitInitialize an instance of TBufStream and open the file.
DoneClose the file and cleans up the instance.
CloseFlush data and Close the file.
FlushFLush data from buffer, and write it to stream.
TruncateFlush buffer, and truncate the file at current position.
SeekSet current position in file.
OpenOpen the file if it is closed.
ReadRead data from the file to a buffer in memory.
WriteWrite data to the file from a buffer in memory.

Fields

LastModeLast file open mode.
BufSizeSize of buffer.
BufPtrPointer to current position in buffer.
BufEndEnd of data in buffer.
BufferActual buffer.

Inherited

From TObject (42)

AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance Create DefaultHandler DefaultHandlerStr Destroy Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.