@Override public int read() throws IOException { if (c1 != -1) { int c = c1; c1 = -1; return c; } int c = super.read(); if ((char)c >= Character.MIN_HIGH_SURROGATE && (char)c <= Character.MAX_HIGH_SURROGATE) { c1 = super.read(); if (Character.isLowSurrogate((char)c1)) { int codePoint = Character.toCodePoint((char)c, (char)c1); codePoint = modifyChar(codePoint); int count = Character.charCount(codePoint); if (count == 1) { c1 = -1; return codePoint; } char[] chars = Character.toChars(codePoint); c1 = chars[1]; return chars[0]; } c1 = modifyChar(c1); } return modifyChar(c); }
@Override public int read() throws IOException { if (c1 != -1) { int c = c1; c1 = -1; return c; } int c = super.read(); if ((char)c >= Character.MIN_HIGH_SURROGATE && (char)c <= Character.MAX_HIGH_SURROGATE) { c1 = super.read(); if (Character.isLowSurrogate((char)c1)) { int codePoint = Character.toCodePoint((char)c, (char)c1); codePoint = modifyChar(codePoint); int count = Character.charCount(codePoint); if (count == 1) { c1 = -1; return codePoint; } char[] chars = Character.toChars(codePoint); c1 = chars[1]; return chars[0]; } c1 = modifyChar(c1); } return modifyChar(c); }
@Override public int read() throws IOException { if (c1 != -1) { int c = c1; c1 = -1; return c; } int c = super.read(); if ((char)c >= Character.MIN_HIGH_SURROGATE && (char)c <= Character.MAX_HIGH_SURROGATE) { c1 = super.read(); if (Character.isLowSurrogate((char)c1)) { int codePoint = Character.toCodePoint((char)c, (char)c1); codePoint = modifyChar(codePoint); int count = Character.charCount(codePoint); if (count == 1) { c1 = -1; return codePoint; } char[] chars = Character.toChars(codePoint); c1 = chars[1]; return chars[0]; } c1 = modifyChar(c1); } return modifyChar(c); }