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
- Object
- ChunkedConversionSink<String>
- StringConversionSink
- Implemented by
Constructors
- StringConversionSink()
- StringConversionSink.from(Sink<String> sink)
-
factory
- StringConversionSink.fromStringSink(StringSink sink)
-
Creates a new instance wrapping the given
sink.…factory - StringConversionSink.withCallback( callback(String accumulated))
-
factory
Properties
- hashCode → int
-
Get a hash code for this object.…
read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.…
inherited
Methods
-
add(
String chunk) → void -
Adds chunked data to this sink.…
inherited -
addSlice(
String chunk, int start, int end, bool isLast) → void -
Adds the next
chunktothis.… -
asStringSink(
) → ClosableStringSink -
Returns
thisas a ClosableStringSink.… -
asUtf8Sink(
bool allowMalformed) → ByteConversionSink -
Returns
thisas a sink that accepts UTF-8 input.… -
close(
) → void -
Closes the sink.…
inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.…
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited