FileByteSource class final

A ByteSource over a file on disk (dart:io; VM/Flutter-native only).

dart:io's RandomAccessFile has a single seek cursor, so concurrent positional reads are serialized internally on one file handle; the pread semantics of the ByteSource contract hold (overlapping read calls never interfere), reads just don't run in parallel at the OS level.

Implemented types

Properties

hashCode int
The hash code for this object.
no setterinherited
length int
Total length of the source in bytes.
final
name String
The path this source was opened from.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Releases any resources held by the source. Idempotent.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(int offset, int length) Future<Uint8List>
Reads exactly length bytes starting at byte offset.
override
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

open(String path) Future<FileByteSource>
Opens path for random-access reading.