decodeToString method

String decodeToString(
  1. List<int> encoded, {
  2. Encoding? encoding,
})

Decodes the encoded Brotli data to the corresponding string.

Use encoding to specify the charset used by encoded.

Implementation

String decodeToString(
  List<int> encoded, {
  Encoding? encoding,
}) {
  final decoded = decoder.convert(encoded);
  return encoding != null
      ? encoding.decode(decoded)
      : String.fromCharCodes(decoded);
}