text: public static Charset parseEncoding(byte[] b) {String enc = parseEncodingName(b);if (enc == null) {return UTF_8;}String name = enc.trim();try {return Charset.forName(name);} catch (IllegalCharsetNameException| UnsupportedCharsetException badName) {Charset aliased = charsetForAlias(name);if (aliased != null) {return aliased;}throw badName;}}