if ("ISO-10646-UCS-4".equals(charset)) {
if (null != isBigEndian) {
boolean isBE = isBigEndian.booleanValue();
if (isBE) {
reader = new UCSReader(istream, UCSReader.UCS4BE);
} else {
reader = new UCSReader(istream, UCSReader.UCS4LE);
}
} else {
// Fatal error, UCSReader will fail to decode this properly
String s = "Unsupported byte order for ISO-10646-UCS-4 encoding.";
throw new UnsupportedEncodingException(s);
}
} else if ("ISO-10646-UCS-2".equals(charset)) {
if (null != isBigEndian) {
boolean isBE = isBigEndian.booleanValue();
if (isBE) {
reader = new UCSReader(istream, UCSReader.UCS4BE);
} else {
reader = new UCSReader(istream, UCSReader.UCS4LE);
}
} else {
// Cannot construct UCSReader without byte order info
String s = "Byte order must be specified for ISO-10646-UCS-2.";
throw new UnsupportedEncodingException(s);