IOSinkBase class abstract

An abstract class that implements dart:io's IOSink's API in terms of onAdd, 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 addStream.

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.
no setterinherited
encoding Encoding
See IOSink.encoding from dart:io.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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 nonexistent method or property is accessed.
inherited
onAdd(List<int> data) → void
A method that handles data events that are passed to the sink.
inherited
onClose() FutureOr<void>
A method that handles the sink being closed.
inherited
onError(Object error, [StackTrace? stackTrace]) → void
A method that handles error events that are passed to the sink.
inherited
onFlush() Future<void>
Flushes any buffered data to the underlying consumer, and returns a future that completes once the consumer has accepted all data.
toString() String
A string representation of this object.
inherited
write(Object? object) → void
See StringSink.write.
writeAll(Iterable<Object?> objects, [String separator = '']) → void
See StringSink.writeAll.
writeCharCode(int charCode) → void
See StringSink.writeCharCode.
writeln([Object? object = '']) → void
See StringSink.writeln.

Operators

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