A sink 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.
The StringConversionSink class provides a default implementation of add, asUtf8Sink and asStringSink.
- Implemented types
Constructors
- StringConversionSink()
-
const
-
StringConversionSink.from(Sink<
String> sink) -
factory
- StringConversionSink.fromStringSink(StringSink sink)
-
Creates a new instance wrapping the given
sink
.factory - StringConversionSink.withCallback(void callback(String accumulated))
-
factory
Properties
- 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(
String str) → void -
Adds chunked data to this sink.
override
-
addSlice(
String chunk, int start, int end, bool isLast) → void -
Adds the next
chunk
tothis
. -
asStringSink(
) → ClosableStringSink -
Returns
this
as a ClosableStringSink. -
asUtf8Sink(
bool allowMalformed) → ByteConversionSink -
Returns
this
as a sink that accepts UTF-8 input. -
close(
) → void -
Closes the sink.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited