InputFileStream class

Stream in data from a file.

Inheritance

Constructors

InputFileStream(String path, {ByteOrder byteOrder = ByteOrder.littleEndian, int bufferSize = FileBuffer.kDefaultBufferSize})
Create an InputFileStream with the given file system [path. A file handle will be created to read from the file at that path. byteOrder determines if multi-byte values are read in bigEndian or littleEndian order. bufferSize determines the size of the cache used by the created FileBuffer.
factory
InputFileStream.fromFileStream(InputFileStream other, {int? position, int? length, int? bufferSize})
Create an InputFileStream from another InputFileStream. If position is provided, it is the offset into other to start reading, relative to the current position of other. Otherwise the current position of other is used. If length is provided, it sets the length of this InputFileStream, otherwise the remaining bytes in other is used. bufferSize determines the size of the cache used by the created FileBuffer.
InputFileStream.withFileBuffer(FileBuffer _file, {ByteOrder byteOrder = ByteOrder.littleEndian})
Create an InputFileStream with the given FileBuffer. byteOrder determines if multi-byte values are read in bigEndian or littleEndian order.
InputFileStream.withFileHandle(AbstractFileHandle fh, {ByteOrder byteOrder = ByteOrder.littleEndian})
Create an InputFileStream with the given AbstractFileHandle. byteOrder determines if multi-byte values are read in bigEndian or littleEndian order.

Properties

byteOrder ByteOrder
The current endian order if the stream.
getter/setter pairinherited
file FileBuffer
no setter
fileRemaining int
no setter
hashCode int
The hash code for this object.
no setterinherited
isEOS bool
Is the current position at the end of the stream?
no setteroverride
length int
How many bytes are left in the stream.
no setteroverride
position int
The current read position relative to the start of the buffer.
getter/setter pairoverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Asynchronously closes the input stream.
override
closeSync() → void
Synchronously closes the input stream.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open() bool
override
peekBytes(int count, {int offset = 0}) InputStream
Read count bytes from an offset of the current read position, without moving the read position.
inherited
readByte() int
Read a single byte.
override
readBytes(int count) InputStream
Read count bytes from the stream.
override
readString({int? size, bool utf8 = true}) String
Read a null-terminated string, or if size is provided, that number of bytes returned as a string.
inherited
readUint16() int
Read a 16-bit word from the stream.
override
readUint24() int
Read a 24-bit word from the stream.
override
readUint32() int
Read a 32-bit word from the stream.
override
readUint64() int
Read a 64-bit word form the stream.
override
readUint8() int
Read a single byte.
inherited
reset() → void
Reset to the beginning of the stream.
override
rewind([int length = 1]) → void
Rewind the read head of the stream by the given number of bytes.
override
setPosition(int v) → void
override
skip(int length) → void
Move the read position by length bytes.
override
subset({int? position, int? length, int? bufferSize}) InputStream
Return a InputStream to read a subset of this stream. It does not move the read position of this stream. position is specified relative to the start of the buffer. If position is not specified, the current read position is used. If length is not specified, the remainder of this stream is used. If bufferSize is provided, and this is an InputFileStream, the returned InputStream will get its own FileBuffer with the given bufferSize, otherwise it will share the FileBuffer of this InputFileStream.
override
toString() String
A string representation of this object.
inherited
toUint8List([Uint8List? bytes]) Uint8List
Convert the remaining bytes to a Uint8List.
override

Operators

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

Static Methods

asRamFile(Stream<Uint8List> stream, int fileLength, {ByteOrder byteOrder = ByteOrder.littleEndian}) Future<InputFileStream>