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 $(D_PSYMBOL ReadBuffer.clear()) before you append the result of the pended asynchronous call.

Constructors

this
this(size_t size, size_t minAvailable, Allocator allocator)
this(Allocator allocator)

Creates a new read buffer.

Destructor

~this
~this()

Deallocates the internal buffer.

Members

Aliases

opDollar
alias opDollar = length

Functions

clear
void clear()

Clears the buffer.

opIndex
T[] opIndex()

Returns a free chunk of the buffer.

opOpAssign
ReadBuffer opOpAssign(size_t length)

Appends some data to the buffer.

opSlice
T[] opSlice(size_t start, size_t end)

Mixins

__anonymous
mixin DefaultAllocator
Undocumented in source.

Properties

capacity
size_t capacity [@property getter]
free
size_t free [@property getter]
length
size_t length [@property getter]

Mixed In Members

From mixin DefaultAllocator

allocator_
Allocator allocator_;

Allocator.

this
this(Allocator allocator)
allocator
shared(Allocator) allocator [@property getter]

This property checks if the allocator was set in the constructor and sets it to the default one, if not.

Parameters

T

Buffer type.

Meta