StringConversionSink class - dart:convert library (original) (raw)

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 ofadd, asUtf8Sink and asStringSink.

Implemented types

Constructors

StringConversionSink.new()

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

hashCodeint

The hash code for this object.

no setterinherited

runtimeTypeType

A representation of the runtime type of the object.

no setterinherited

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 to this.

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