RecyclingInputStreamReader extends Reader { @Override public int read(final char[] cbuf, final int off, final int len) throws IOException { return reader.read(cbuf, off, len); } RecyclingInputStreamReader(final InputStream in);  RecyclingInputStreamReader(final InputStream in, final String charsetName);  RecyclingInputStreamReader(final InputStream in, final Charset cs); @Override void close(); @Override int read(final char[] cbuf, final int off, final int len); @Override void mark(final int readAheadLimit); @Override boolean markSupported(); @Override int read(); @Override int read(final char[] cbuf); @Override int read(final CharBuffer target); @Override boolean ready(); @Override void reset(); @Override long skip(final long n); @Override String toString();  }
@Test public void testRead() throws IOException { RecyclingInputStreamReader reader = new RecyclingInputStreamReader(istream); try { assertTrue(reader.ready()); char[] cbuf = new char[HELLO.length()]; reader.read(cbuf); assertEquals(HELLO, new String(cbuf)); } finally { reader.close(); log.info(reader + " was closed."); } }