Class ReadBuffer
Self-expanding buffer, that can be used with functions returning the number
of the read bytes.
This buffer supports asynchronous reading. It means you can pass a new chunk
to an asynchronous read function during you are working with already
available data. But only one asynchronous call at a time is supported. Be
sure to call ReadBuffer.clear() before you append the result
of the pended asynchronous call.
Constructors
Name | Description |
this
(size, minAvailable)
|
Creates a new read buffer.
|
Fields
Name | Type | Description |
blockSize
|
immutable(ulong) | Size by which the buffer will grow.
|
buffer_
|
ubyte[] | Internal buffer.
|
length_
|
ulong | Filled buffer length.
|
minAvailable
|
immutable(ulong) | Available space.
|
ring
|
ulong | Last position returned with [].
|
start
|
ulong | Start of available data.
|
Methods
Name | Description |
clear
()
|
Clears the buffer.
|
opIndex
()
|
Returns a free chunk of the buffer.
|
opOpAssign
(length)
|
Appends some data to the buffer.
|