StringConversionSink abstract class

This class provides an interface for converters to efficiently transmit String data.

Instead of limiting the interface to one non-chunked String it accepts partial strings or can be transformed into a byte sink that accepts UTF-8 code units.

This abstract class will likely get more methods over time. Implementers are urged to extend StringConversionSinkBase or to mix in StringConversionSinkMixin, to ensure that their class covers the newly added methods.

Inheritance
Implemented by

Constructors

StringConversionSink()
StringConversionSink.from(Sink<String> sink)
factory
StringConversionSink.fromStringSink(StringSink sink)
factory

Creates a new instance wrapping the given sink.

StringConversionSink.withCallback(void callback(String accumulated))
factory

Properties

hashCodeint
read-only, inherited

The hash code for this object.

runtimeTypeType
read-only, inherited

A representation of the runtime type of the object.

Operators

operator ==(other) → bool
inherited

The equality operator.

Methods

addSlice(String chunk, int start, int end, bool isLast) → void

Adds the next chunk to this.

asStringSink() → ClosableStringSink

Returns this as a ClosableStringSink.

asUtf8Sink(bool allowMalformed) → ByteConversionSink

Returns this as a sink that accepts UTF-8 input.

add(String chunk) → void
inherited

Adds chunked data to this sink.

close() → void
inherited

Closes the sink.

noSuchMethod(Invocation invocation) → dynamic
inherited

Invoked when a non-existent method or property is accessed.

toString() → String
inherited

Returns a string representation of this object.

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-convert/StringConversionSink-class.html