RealBufferedSource class

Implemented types
Available Extensions

Constructors

RealBufferedSource(Source source)

Properties

buffer Buffer
This source's internal buffer.
no setteroverride
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() Future<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.
override
exhausted() Future<bool>
Returns true if there are no more bytes in this source.
override
indexOf(int element, [int start = 0, int? end]) Future<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.
override
indexOfBytes(Uint8List bytes, [int start = 0, int? end]) Future<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.
override
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.
override
rangeEquals(int offset, List<int> bytes, [int start = 0, int? end]) Future<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.
override
read(Buffer sink, int count) Future<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.
override
readBytes([int? count]) Future<Uint8List>
Removes bytes (all bytes if count is null) from this and returns them as a list of bytes.
override
readFloat32([Endian endian = Endian.big]) Future<double>
Removes four bytes from this source.
override
readFloat64([Endian endian = Endian.big]) Future<double>
Removes eight bytes from this source.
override
readInt16([Endian endian = Endian.big]) Future<int>
Removes two bytes from this source.
override
readInt32([Endian endian = Endian.big]) Future<int>
Removes four bytes from this source.
override
readInt64([Endian endian = Endian.big]) Future<int>
Removes eight bytes from this source.
override
readInt8() Future<int>
Removes a byte from this source.
override
readIntoBytes(List<int> sink, [int start = 0, int? end]) Future<int>
Removes exactly end - start bytes from this and copies them into sink.
override
readIntoSink(Sink sink) Future<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.
override
readLine({Encoding encoding = utf8}) Future<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.
override
readLineStrict({Encoding encoding = utf8, int? end}) Future<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.
override
readString({Encoding encoding = utf8, int? count}) Future<String>
Removes bytes (all bytes if count is null) from this and returns the string. Returns the empty string if this source is empty.
override
readUint16([Endian endian = Endian.big]) Future<int>
Removes two bytes from this source.
override
readUint32([Endian endian = Endian.big]) Future<int>
Removes four bytes from this source.
override
readUint64([Endian endian = Endian.big]) Future<int>
Removes eight bytes from this source.
override
readUint8() Future<int>
Removes a byte from this source.
override
request(int count) Future<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.
override
require(int count) Future<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.
override
skip(int count) Future<void>
Reads and discards count bytes from this source. Throws an EOFException if the source is exhausted before the requested bytes can be skipped.
override
toString() String
A string representation of this object.
override

Operators

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