API
TransportFilesFactoryโ
Declaration
class TransportFilesFactory {
TransportFile open(
String path, {
TransportFileMode mode = TransportFileMode.readWriteAppend,
bool create = false,
bool truncate = false,
})
}
Methodsโ
openโ
Opens a new file for manipulations.
TransportFileโ
Declaration
class TransportFile {
final File delegate;
Stream<TransportPayload> get inbound
bool get active
void read({int blocksCount = 1, int offset = 0})
void writeSingle(Uint8List bytes, {void Function(Exception error)? onError, void Function()? onDone})
void writeMany(List<Uint8List> bytes, {void Function(Exception error)? onError, void Function()? onDone})
Future<Uint8List> load({int blocksCount = 1, int offset = 0})
Future<void> close({Duration? gracefulTimeout}) => _file.close(gracefulTimeout: gracefulTimeout)
}
Propertiesโ
delegateโ
Dart file object.
inboundโ
Stream for inbound (read) payloads.
activeโ
Is the file open?
Methodsโ
readโ
Sends a read operation to the file.
writeSingleโ
Writes a single buffer to the file.
writeManyโ
Writes many buffers to the file.
loadโ
Reads all the file content.
closeโ
Closes the file.