getEncoding function

Encoding getEncoding(
  1. int typeId
)

Gets the Encoding by it's typeId

Implementation

Encoding getEncoding(int typeId) {
  switch (typeId) {
    case EncodingBytes.latin1:
      return latin1;
    case EncodingBytes.utf8:
      return const Utf8Codec(allowMalformed: true);
    case EncodingBytes.utf16:
      return UTF16LE();
    case EncodingBytes.utf16be:
      return UTF16BE();
    default:
      return HEXEncoding();
  }
}