FileStream class
Implementation of RandomAccessStream which reads from a file Currently this does not perform smart buffering and can be quite slow
Wrap a FileStream in a BufferedRandomAccessStream to improve performance
- Inheritance
-
- Object
- RandomAccessStream
- FileStream
Constructors
- FileStream.new(RandomAccessFile _file)
- Create a new FileStream from a file
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
length
→ Future<
int> -
Returns the length of the stream in bytes.
latefinal
-
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