asByteSink method

ByteConversionSink asByteSink(
  1. Sink<List<int>> sink
)

Ensure a conversion to ByteConversionSink which provides an interface for converters to efficiently transmit byte data.

Implementation

ByteConversionSink asByteSink(Sink<List<int>> sink) {
  ByteConversionSink byteSink;
  if (sink is! ByteConversionSink) {
    byteSink = ByteConversionSink.from(sink);
  } else {
    byteSink = sink;
  }
  return byteSink;
}