convert method

  1. @override
List<int> convert(
  1. List<int> bytes
)
override

Encode/Decode a List of bytes.

Attempt one-shot all in-memory conversion first. If this attempt fails (since it may not be supported), then perform chunked conversion.

Implementation

@override
List<int> convert(List<int> bytes) {
  final sink = BufferSink();
  if (performOneShotConversion(sink, bytes) == false) {
    startChunkedConversion(sink)
      ..add(bytes)
      ..close();
  }
  return sink.builder.takeBytes();
}