BufferedRandomAccessStream class
Implementation of RandomAccessStream which buffers reads from another stream This is useful for improving performance when reading from a slow stream
- Inheritance
-
- Object
- RandomAccessStream
- BufferedRandomAccessStream
Constructors
- BufferedRandomAccessStream.new(RandomAccessStream _stream, {int blockSize = 1024 * 1024, int maxNumBlocks = 10})
- Create a new BufferedRandomAccessStream from another RandomAccessStream Using this class with a full ByteStream is not recommended
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
length
→ Future<
int> -
Returns the length of the stream in bytes.
no setteroverride
-
position
→ Future<
int> -
Returns the current position in the stream.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
fastRead(
int count) → Future< Uint8List> -
A potentially faster variant of readBuffer.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
peekByte(
) → Future< int> -
Returns the next byte in the stream without advancing the position.
Returns -1 if the end of the stream has been reached.
override
-
readBuffer(
int count, Uint8List into) → Future< int> -
Attempts to read
count
bytes from the stream intointo
. Returns the number of bytes read (which can be <count
if the end of the stream has been reached).override -
readByte(
) → Future< int> -
Attempts to read a single byte from the stream. Reading past the end of
the stream will return -1.
override
-
readLine(
) → Future< String> -
Reads a single line from the stream. A line is terminated by 0x0A (possibly preceded by 0x0D).
The line terminator is not included in the returned string.
Throws an EOFException if the end of the stream is reached before a line terminator is found AND no characters have been read.
inherited
-
seek(
int offset) → Future< void> -
Seeks to the given
offset
in the stream (from the beginning).override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited