Buffer class
Buffer
Methods
-
any(bool test(int element))
→ bool
-
Checks whether any element of this iterable satisfies
test.
inherited
-
asByteData([int offset = 0, int? length])
→ ByteData
-
Creates a ByteData view over a region of the buffer.
-
asUint8List()
→ Uint8List
-
Creates a Uint8List view over the buffer.
-
cast<R>()
→ Iterable<R>
-
A view of this iterable as an iterable of
R instances.
inherited
-
contains(Object? element)
→ bool
-
Whether the collection contains an element equal to
element.
inherited
-
copy(Buffer dst, [int dstOffset = 0, int offset = 0, int? length])
→ void
-
Copies items from
this buffer to the destination (dst) buffer.
-
elementAt(int index)
→ int
-
Returns the
indexth element.
inherited
-
every(bool test(int element))
→ bool
-
Checks whether every element of this iterable satisfies
test.
inherited
-
expand<T>(Iterable<T> toElements(int element))
→ Iterable<T>
-
Expands each element of this Iterable into zero or more elements.
inherited
-
firstWhere(bool test(int element), {int orElse()?})
→ int
-
The first element that satisfies the given predicate
test.
inherited
-
fold<T>(T initialValue, T combine(T previousValue, int element))
→ T
-
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
followedBy(Iterable<int> other)
→ Iterable<int>
-
Creates the lazy concatenation of this iterable and
other.
inherited
-
forEach(void action(int element))
→ void
-
Invokes
action on each element of this iterable in iteration order.
inherited
-
getAll(int offset)
→ Iterable<int>
-
Reads the buffer starting at
offset into a byte array.
-
getBigInt(int offset, int length, [Endian endian = Endian.little])
→ BigInt
-
Reads a region of the buffer as a
signed big integer.
-
getBigUint(int offset, int length, [Endian endian = Endian.little])
→ BigInt
-
Reads a region of the buffer as an
unsigned big integer.
-
getBool(int offset)
→ bool
-
Reads
1-byte as a boolean.
-
getDateTime(int offset, [Endian endian = Endian.little])
→ DateTime
-
Reads an
i64 from the buffer as an epoch timestamp.
-
getFloat32(int offset, [Endian endian = Endian.little])
→ double
-
Reads
4-bytes as a floating point value.
-
getFloat64(int offset, [Endian endian = Endian.little])
→ double
-
Reads
8-bytes as a double precision floating point value.
-
getInt(int offset, int length, [Endian endian = Endian.little])
→ int
-
Reads a region of the buffer as a
signed integer.
-
getInt128(int offset, [Endian endian = Endian.little])
→ BigInt
-
Reads
16-bytes as a signed integer.
-
getInt16(int offset, [Endian endian = Endian.little])
→ int
-
Reads
2-bytes as a signed integer.
-
getInt32(int offset, [Endian endian = Endian.little])
→ int
-
Reads
4-bytes as a signed integer.
-
getInt64(int offset, [Endian endian = Endian.little])
→ int
-
Reads
8-bytes as a signed integer.
-
getInt8(int offset)
→ int
-
Reads
1-byte as a signed integer.
-
getString(BufferEncoding encoding, [int offset = 0, int? length])
→ String
-
Reads a region of the buffer as an
encoded string.
-
getUint(int offset, int length, [Endian endian = Endian.little])
→ int
-
Reads a region of the buffer as an
unsigned integer.
-
getUint128(int offset, [Endian endian = Endian.little])
→ BigInt
-
Reads
16-bytes as an unsigned integer.
-
getUint16(int offset, [Endian endian = Endian.little])
→ int
-
Reads
2-bytes as an unsigned integer.
-
getUint32(int offset, [Endian endian = Endian.little])
→ int
-
Reads
4-bytes as an unsigned integer.
-
getUint64(int offset, [Endian endian = Endian.little])
→ BigInt
-
Reads
8-bytes as an unsigned integer.
-
getUint8(int offset)
→ int
-
Reads
1-byte as an unsigned integer.
-
join([String separator = ""])
→ String
-
Converts each element to a String and concatenates the strings.
inherited
-
lastWhere(bool test(int element), {int orElse()?})
→ int
-
The last element that satisfies the given predicate
test.
inherited
-
map<T>(T toElement(int e))
→ Iterable<T>
-
The current elements of this iterable modified by
toElement.
inherited
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
reduce(int combine(int value, int element))
→ int
-
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
setAll(int offset, Iterable<int> bytes)
→ void
-
Writes a
byte array to a region of the buffer starting at offset.
-
setBigInt(BigInt value, int offset, [int? length, Endian endian = Endian.little])
→ int
-
Writes a
big signed integer to a region of the buffer.
-
setBigUint(BigInt value, int offset, [int? length, Endian endian = Endian.little])
→ int
-
Writes a
big unsigned integer to a region of the buffer.
-
setBool(bool value, int offset)
→ int
-
Writes a
boolean value to 1-byte.
-
setDateTime(DateTime value, int offset, [Endian endian = Endian.little])
→ void
-
Writes a DateTime to the buffer as an
i64.
-
setFloat32(double value, int offset, [Endian endian = Endian.little])
→ void
-
Writes a
floating point value to 4-bytes.
-
setFloat64(double value, int offset, [Endian endian = Endian.little])
→ void
-
Writes a
double precision floating point value to 8-bytes.
-
setInt(int value, int offset, int length, [Endian endian = Endian.little])
→ int
-
Writes a
signed integer to a region of the buffer.
-
setInt128(BigInt value, int offset, [Endian endian = Endian.little])
→ void
-
Writes a
signed integer to 16-bytes.
-
setInt16(int value, int offset, [Endian endian = Endian.little])
→ void
-
Writes a
signed integer to 2-bytes.
-
setInt32(int value, int offset, [Endian endian = Endian.little])
→ void
-
Writes a
signed integer to 4-bytes.
-
setInt64(int value, int offset, [Endian endian = Endian.little])
→ void
-
Writes a
signed integer to 8-bytes.
-
setInt8(int value, int offset)
→ void
-
Writes a
signed integer to 1-byte.
-
setString(String value, BufferEncoding encoding, [int offset = 0, int? length])
→ int
-
Writes an `encoded
value to a region of the buffer.
-
setUint(int value, int offset, int length, [Endian endian = Endian.little])
→ int
-
Writes an
unsigned integer to a region of the buffer.
-
setUint128(BigInt value, int offset, [Endian endian = Endian.little])
→ void
-
Writes an
unsigned integer to 16-bytes.
-
setUint16(int value, int offset, [Endian endian = Endian.little])
→ void
-
Writes an
unsigned integer to 2-bytes.
-
setUint32(int value, int offset, [Endian endian = Endian.little])
→ void
-
Writes an
unsigned integer to 4-bytes.
-
setUint64(BigInt value, int offset, [Endian endian = Endian.little])
→ void
-
Writes an
unsigned integer to 8-bytes.
-
setUint8(int value, int offset)
→ void
-
Writes an
unsigned integer to 1-byte.
-
singleWhere(bool test(int element), {int orElse()?})
→ int
-
The single element that satisfies
test.
inherited
-
skip(int count)
→ Iterable<int>
-
Creates an Iterable that provides all but the first
count elements.
inherited
-
skipWhile(bool test(int value))
→ Iterable<int>
-
Creates an
Iterable that skips leading elements while test is satisfied.
inherited
-
slice([int offset = 0, int? length])
→ Buffer
-
Creates a new Buffer from a region of
this buffer.
-
take(int count)
→ Iterable<int>
-
Creates a lazy iterable of the
count first elements of this iterable.
inherited
-
takeWhile(bool test(int value))
→ Iterable<int>
-
Creates a lazy iterable of the leading elements satisfying
test.
inherited
-
toList({bool growable = true})
→ List<int>
-
Creates a List containing the elements of this Iterable.
inherited
-
toSet()
→ Set<int>
-
Creates a Set containing the same elements as this iterable.
inherited
-
toString()
→ String
-
Returns a string representation of (some of) the elements of
this.
inherited
-
where(bool test(int element))
→ Iterable<int>
-
Creates a new lazy Iterable with all elements that satisfy the
predicate
test.
inherited
-
whereType<T>()
→ Iterable<T>
-
Creates a new lazy Iterable with all elements that have type
T.
inherited