BufferedSource class abstract interface

Implemented types
Implementers
Available Extensions

Constructors

BufferedSource()

Properties

buffer Buffer
This source's internal buffer.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() FutureOr<void>
Closes this source and releases the resources held by this source. It is an error to read a closed source. It is safe to close a source more than once.
inherited
exhausted() FutureOr<bool>
Returns true if there are no more bytes in this source.
indexOf(int element, [int start = 0, int? end]) FutureOr<int>
Returns the index of element if it is found in the range of start inclusive to end exclusive. If element isn't found, or if start == end, then -1 is returned.
indexOfBytes(Uint8List bytes, [int start = 0, int? end]) FutureOr<int>
Returns the index of the first match for bytes in the range of start inclusive to end exclusive. This expands the buffer as necessary until bytes is found. This reads an unbounded number of bytes into the buffer. Returns -1 if the stream is exhausted before the requested bytes are found.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
peek() FutureOr<BufferedSource>
Returns a new BufferedSource that can read data from this BufferedSource without consuming it. The returned source becomes invalid once this source is next read or closed.
rangeEquals(int offset, List<int> bytes, [int start = 0, int? end]) FutureOr<bool>
Returns true if end - start bytes at offset in this source equal bytes at start. This expands the buffer as necessary until a byte does not match, all bytes are matched, or if the stream is exhausted before enough bytes could determine a match.
read(Buffer sink, int count) FutureOr<int>
Removes at least 1, and up to count bytes from this and appends them to sink. Returns the number of bytes read, or 0 if this source is exhausted.
inherited
readBytes([int? count]) FutureOr<Uint8List>
Removes bytes (all bytes if count is null) from this and returns them as a list of bytes.
readFloat32([Endian endian = Endian.big]) FutureOr<double>
Removes four bytes from this source.
readFloat64([Endian endian = Endian.big]) FutureOr<double>
Removes eight bytes from this source.
readInt16([Endian endian = Endian.big]) FutureOr<int>
Removes two bytes from this source.
readInt32([Endian endian = Endian.big]) FutureOr<int>
Removes four bytes from this source.
readInt64([Endian endian = Endian.big]) FutureOr<int>
Removes eight bytes from this source.
readInt8() FutureOr<int>
Removes a byte from this source.
readIntoBytes(List<int> sink, [int start = 0, int? end]) FutureOr<int>
Removes exactly end - start bytes from this and copies them into sink.
readIntoSink(Sink sink) FutureOr<int>
Removes all bytes from this and appends them to sink. Returns the total number of bytes written to sink which will be 0 if this is exhausted.
readLine({Encoding encoding = utf8}) FutureOr<String?>
Removes and returns characters up to but not including the next line break. A line break is either "\n" or "\r\n"; these characters are not included in the result.
readLineStrict({Encoding encoding = utf8, int? end}) FutureOr<String>
Removes and returns characters up to but not including the next line break. A line break is either "\n" or "\r\n"; these characters are not included in the result.
readString({Encoding encoding = utf8, int? count}) FutureOr<String>
Removes bytes (all bytes if count is null) from this and returns the string. Returns the empty string if this source is empty.
readUint16([Endian endian = Endian.big]) FutureOr<int>
Removes two bytes from this source.
readUint32([Endian endian = Endian.big]) FutureOr<int>
Removes four bytes from this source.
readUint64([Endian endian = Endian.big]) FutureOr<int>
Removes eight bytes from this source.
readUint8() FutureOr<int>
Removes a byte from this source.
request(int count) FutureOr<bool>
Returns true when the buffer contains at least count bytes, expanding it as necessary. Returns false if the source is exhausted before the requested bytes can be read.
require(int count) FutureOr<void>
Returns when the buffer contains at least count bytes. Throws an EOFException if the source is exhausted before the required bytes can be read.
skip(int count) FutureOr<void>
Reads and discards count bytes from this source. Throws an EOFException if the source is exhausted before the requested bytes can be skipped.
toString() String
A string representation of this object.
inherited

Operators

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