StringConversionSink class

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

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.

Extends:
Implementors

Constructors

StringConversionSink ( )
StringConversionSink.withCallback ( void callback(String accumulated) )
StringConversionSink.from ( Sink<String> sink )
StringConversionSink.fromStringSink ( StringSink sink )
Creates a new instance wrapping the given sink.

Instance Methods

addSlice ( String chunk, int start, int end, bool isLast ) → void
Adds the next chunk to this.
asUtf8Sink ( bool allowMalformed ) → ByteConversionSink
Returns this as a sink that accepts UTF-8 input.
asStringSink ( ) → ClosableStringSink
Returns this as a ClosableStringSink.
add Inherited ( String chunk ) → void
Adds chunked data to this sink.
close Inherited ( ) → void
Closes the sink.