InputFileStream class
Stream in data from a file.
- Inheritance
-
- Object
- InputStream
- InputFileStream
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.byteOrderdetermines if multi-byte values are read in bigEndian or littleEndian order.bufferSizedetermines 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
positionis provided, it is the offset intootherto start reading, relative to the current position ofother. Otherwise the current position ofotheris used. Iflengthis provided, it sets the length of this InputFileStream, otherwise the remaining bytes inotheris used.bufferSizedetermines 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.
byteOrderdetermines 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.
byteOrderdetermines 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
countbytes from anoffsetof the current read position, without moving the read position.inherited -
readByte(
) → int -
Read a single byte.
override
-
readBytes(
int count) → InputStream -
Read
countbytes from the stream.override -
readString(
{int? size, bool utf8 = true}) → String -
Read a null-terminated string, or if
sizeis 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
lengthbytes.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.
positionis specified relative to the start of the buffer. Ifpositionis not specified, the current read position is used. Iflengthis not specified, the remainder of this stream is used. IfbufferSizeis provided, and this is an InputFileStream, the returned InputStream will get its own FileBuffer with the givenbufferSize, 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