@Test public void readWithCharArrayAndDelegateEOF() throws IOException { when(mockDelegate.read((char[]) Mockito.anyVararg(), Mockito.anyInt(), Mockito.anyInt())).thenReturn(-1); final char[] buffer = new char[10]; assertEquals(-1, cut.read(buffer)); }
@Override public int read() throws IOException { int fromDelegate = delegate.read(); if (fromDelegate < 0) { return fromDelegate; } char c = (char) fromDelegate; while (invalidCharsPattern.matcher(String.valueOf(c)).find()) { fromDelegate = delegate.read(); if (fromDelegate < 0) { return fromDelegate; } c = (char) fromDelegate; } return fromDelegate; }
EscapingReader extends Reader { @Override public int read() throws IOException { int fromDelegate = delegate.read(); if (fromDelegate < 0) { return fromDelegate; } char c = (char) fromDelegate; while (invalidCharsPattern.matcher(String.valueOf(c)).find()) { fromDelegate = delegate.read(); if (fromDelegate < 0) { return fromDelegate; } c = (char) fromDelegate; } return fromDelegate; } }
EscapingReader extends Reader { @Override public int read() throws IOException { int fromDelegate = delegate.read(); if (fromDelegate < 0) { return fromDelegate; } char c = (char) fromDelegate; while (invalidCharsPattern.matcher(String.valueOf(c)).find()) { fromDelegate = delegate.read(); if (fromDelegate < 0) { return fromDelegate; } c = (char) fromDelegate; } return fromDelegate; } EscapingReader(Reader delegate);  EscapingReader(Object lock, Reader delegate); }
EscapingReader extends Reader { @Override public int read() throws IOException { int fromDelegate = delegate.read(); if (fromDelegate < 0) { return fromDelegate; } char c = (char) fromDelegate; while (invalidCharsPattern.matcher(String.valueOf(c)).find()) { fromDelegate = delegate.read(); if (fromDelegate < 0) { return fromDelegate; } c = (char) fromDelegate; } return fromDelegate; } EscapingReader(Reader delegate);  EscapingReader(Object lock, Reader delegate); @Override int read(); @Override int read(char[] cbuf, int off, int len); @Override long skip(long n); @Override boolean ready(); @Override boolean markSupported(); @Override void mark(int readAheadLimit); @Override void reset(); @Override void close(); }
EscapingReader extends Reader { @Override public int read() throws IOException { int fromDelegate = delegate.read(); if (fromDelegate < 0) { return fromDelegate; } char c = (char) fromDelegate; while (invalidCharsPattern.matcher(String.valueOf(c)).find()) { fromDelegate = delegate.read(); if (fromDelegate < 0) { return fromDelegate; } c = (char) fromDelegate; } return fromDelegate; } EscapingReader(Reader delegate);  EscapingReader(Object lock, Reader delegate); @Override int read(); @Override int read(char[] cbuf, int off, int len); @Override long skip(long n); @Override boolean ready(); @Override boolean markSupported(); @Override void mark(int readAheadLimit); @Override void reset(); @Override void close();  }