Struct ReadBuffer
Self-expanding buffer, that can be used with functions returning the number
of the read bytes.
struct ReadBuffer(T)
if (isScalarType!T);
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, allocator)
|
Creates a new read buffer.
|
Fields
Name | Type | Description |
blockSize
|
size_t | Size by which the buffer will grow.
|
buffer_
|
T[] | Internal buffer.
|
length_
|
size_t | Filled buffer length.
|
minAvailable
|
size_t | Available space.
|
ring
|
size_t | Last position returned with [].
|
start
|
size_t | 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.
|
opSlice
(start, end)
|
|
Parameters
Name | Description |
T | Buffer type. |