Description | |
|
The BufferedStream class provides direct read and write access to a stream. This access is buffered to improve performance.
The buffer size is 4,096 bytes by default, but may be overriden.
BufferedStream can be used with BinaryReader and BinaryWriter for handling low level data, but you are restricted to read or write operations appropriately.
Some streams, support direct read and write access. You can use a buffered stream to access these - see the Seek mtheod example code. |
|
Syntax | |
| Constructor Create ( | DataStream : Stream
; ); | Constructor Create ( | DataStream : Stream; BufferSize : Integer ); |
|
Methods | |
| | Close | Closes the BufferedStream | | Read | Reads the next block of characters from the current stream | | ReadByte | Read the next Byte from the current stream | | Seek | Moves the current position in the buffered stream to the specified value | | SetLength | Sets the length of the stream (not the buffer it uses) | | Write | Writes some or all bytes from a Byte Array into the current stream | | WriteByte | Write a single Byte to the current stream position |
|
|
|
Properties | |
| CanRead | | Boolean | | Gets a value indicating whether the current stream supports reading.
| CanSeek | | Boolean | | Gets a value indicating whether the current stream supports seeking.
| CanWrite | | Boolean | | Gets a value indicating whether the current stream supports writing.
| Length | | Integer | | Gets the stream length in bytes.
| Position | | Integer | | Gets the position within the current stream. |
|
Microsoft MSDN links | |
|
|