IOSinkBase class Null safety

An abstract class that implements dart:io's IOSink's API in terms of onData, onError, onClose, and onFlush methods.

Because IOSink is defined in dart:io, this can't officially implement it. However, it's designed to match its API exactly so that subclasses can implement IOSink without any additional modifications.

This takes care of ensuring that events can't be added after close is called or during a call to onStream.

Inheritance
Available Extensions
Annotations
  • @Deprecated('Will be removed in the next major release')

Constructors

IOSinkBase([Encoding encoding = utf8])

Properties

done Future<void>
Return a future which is completed when the StreamSink is finished.
read-onlyinherited
encoding Encoding
See IOSink.encoding from dart:io.
read / write
hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

add(List<int> data) → void
Adds a data event to the sink.
inherited
addError(Object error, [StackTrace? stackTrace]) → void
Adds an error to the sink.
inherited
addStream(Stream<List<int>> stream) Future<void>
Consumes the elements of stream.
inherited
close() Future<void>
Closes the sink.
inherited
flush() Future<void>
See IOSink.flush from dart:io.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
onAdd(List<int> data) → void
A method that handles data events that are passed to the sink.
visibleForOverriding">@visibleForOverridinginherited
onClose() FutureOr<void>
A method that handles the sink being closed.
visibleForOverriding">@visibleForOverridinginherited
onError(Object error, [StackTrace? stackTrace]) → void
A method that handles error events that are passed to the sink.
visibleForOverriding">@visibleForOverridinginherited
onFlush() Future<void>
Flushes any buffered data to the underlying consumer, and returns a future that completes once the consumer has accepted all data.
visibleForOverriding">@visibleForOverriding
toString() String
A string representation of this object.
inherited
write(Object? object) → void
See IOSink.write from dart:io.
writeAll(Iterable<Object?> objects, [String separator = '']) → void
See IOSink.writeAll from dart:io.
writeCharCode(int charCode) → void
See IOSink.writeCharCode from dart:io.
writeln([Object? object = '']) → void
See IOSink.writeln from dart:io.

Operators

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