getCodec method Null safety

Codec getCodec(
  1. CharacterSet? characterSet
)

Rerieves the codec for the specified characterSet.

Implementation

static Codec getCodec(CharacterSet? characterSet) {
  switch (characterSet) {
    case null:
      return utf8;
    case CharacterSet.ascii:
      return ascii;
    case CharacterSet.utf8:
      return utf8;
    case CharacterSet.latin1:
      return latin1;
  }
}