BufStream unit
Implements Buffered streams.
BufStream implements buffered streams. The streams store all
data from (or for) the source stream in a memory buffer, and only flush the
buffer when it's full (or refill it when it's empty).
Buffered streams can help in speeding up read or write operations, especially when a lot of small read/write operations are done. They avoid doing a lot of operating system calls.
TReadBufStream is used for reading only, and allows the buffer size to be specified at the time of creation.
TWriteBufStream is used for writing only, and allows the buffer size to be specified at the time of creation.
TBufferedFileStream can be used for reading and writing depending on the file mode specified at the time of creation. By default, it uses an internal buffer with 8 pages using a 4,096 byte page size. Both page count and page size are configurable using methods in the class.
Classes and records
TBufferedFileStream | class | Implements a buffered file stream with a multi-page buffer. |
TBufStream | class | Common ancestor for buffered streams. |
TReadBufStream | class | Read-only buffered stream. |
TWriteBufStream | class | Write-only buffered stream. |
Constants
DefaultBufferCapacity | constant | Default buffer size. |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
