UnsyncCharArrayReader extends Reader { @Override public boolean ready() throws IOException { if (_buffer == null) { throw new IOException("Stream closed"); } if (_capacity > _index) { return true; } return false; } UnsyncCharArrayReader(char[] chars);  UnsyncCharArrayReader(char[] chars, int offset, int length); @Override void close(); @Override void mark(int readAheadLimit); @Override boolean markSupported(); @Override int read(); @Override int read(char[] chars); @Override int read(char[] chars, int offset, int length); @Override int read(CharBuffer charBuffer); @Override boolean ready(); @Override void reset(); @Override long skip(long skip);  }
@Override @Test public void testReady() throws IOException { UnsyncCharArrayReader unsyncCharArrayReader = new UnsyncCharArrayReader( _BUFFER); Assert.assertTrue(unsyncCharArrayReader.ready()); unsyncCharArrayReader.read(CharBuffer.allocate(_SIZE)); Assert.assertFalse(unsyncCharArrayReader.ready()); }