@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(char[] cbuf, int off, int len) throws IOException { if (len <= 0) { if (len < 0) { throw new IndexOutOfBoundsException(); } else if ((off < 0) || (off > cbuf.length)) { throw new IndexOutOfBoundsException(); } return 0; } int chars = 0; while (chars <= len) { int c = read(); if (c == -1) { if (chars == 0) { return -1; } break; } cbuf[off++] = (char)c; chars++; } return chars; }
@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(char[] cbuf, int off, int len) throws IOException { if (len <= 0) { if (len < 0) { throw new IndexOutOfBoundsException(); } else if ((off < 0) || (off > cbuf.length)) { throw new IndexOutOfBoundsException(); } return 0; } int chars = 0; while (chars <= len) { int c = read(); if (c == -1) { if (chars == 0) { return -1; } break; } cbuf[off++] = (char)c; chars++; } return chars; }
@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(char[] cbuf, int off, int len) throws IOException { if (len <= 0) { if (len < 0) { throw new IndexOutOfBoundsException(); } else if ((off < 0) || (off > cbuf.length)) { throw new IndexOutOfBoundsException(); } return 0; } int chars = 0; while (chars <= len) { int c = read(); if (c == -1) { if (chars == 0) { return -1; } break; } cbuf[off++] = (char)c; chars++; } return chars; }
@Override public Reader getReader(Reader reader) { return new UpperLowerReader(reader, false); } }, str.getLength()));
@Override public Reader getReader(Reader reader) { return new UpperLowerReader(reader, true); } }, str.getLength()));
@Override public Reader getReader(Reader reader) { return new UpperLowerReader(reader, false); } }, str.getLength()));
@Override public Reader getReader(Reader reader) { return new UpperLowerReader(reader, true); } }, str.getLength()));
@Override public Reader getReader(Reader reader) { return new UpperLowerReader(reader, true); } }, str.getLength()));
@Override public Reader getReader(Reader reader) { return new UpperLowerReader(reader, false); } }, str.getLength()));