getByEncoding static method

List<int> getByEncoding(
  1. Encoding encoding
)

Implementation

static List<int> getByEncoding(Encoding encoding) {
  switch (encoding.runtimeType) {
    case Latin1Codec:
      return latin1Termination;
    case UTF16LE:
    case UTF16BE:
      return utf16Termination;
    case Utf8Codec:
      return utf8Termiantion;
    default:
      throw UnimplementedError('Codec ${encoding.runtimeType} is not implemented yet');
  }
}