CodecBufferHolder<T, CB extends CodecBuffer<T>> class

Provides a simple buffer holder/builder with a customizable builder function bufferBuilderFunc.

The motivation is to help subclasses of CodecFilter to customize the building of CodecBuffer by adjusting either the length or the buffer construction call itself.

Some algorithms (i.e. Lz4 Decoding) need to compute the size of one buffer by reading some header information from another buffer. Having a more customizable buffer builder helps makes this easier.

A CodecBufferHolder may only construct one CodecBuffer so when CodecBufferHolder.buffer is sent multiple times, the same instance will be returned.

Implementers

Constructors

CodecBufferHolder(int _length, CB bufferBuilderFunc(int length))
Construct a new buffer holder with the specific length.

Properties

buffer → CB
Returns a constructed CodecBuffer.
no setter
bufferBuilderFunc ↔ CB Function(int length)
Custom function which takes a length and answers a CodecBuffer.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
length int
Returns buffer length (bytes) or a default value.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

isBufferSet() bool
Return true if buffer is set, false otherwise.
isLengthSet() bool
Return true if length is set, false otherwise.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
release() → void
Release the memory for any existing buffer if necessary.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

autoLength → const int
Signals the length of the CodecBuffer should be left to the algorithm to determine.