UnsyncByteArrayInputStream extends InputStream { @Override public int available() { return _capacity - _index; } UnsyncByteArrayInputStream(byte[] buffer);  UnsyncByteArrayInputStream(byte[] buffer, int offset, int length); @Override int available(); @Override void mark(int readAheadLimit); @Override boolean markSupported(); @Override int read(); @Override int read(byte[] bytes); @Override int read(byte[] bytes, int offset, int length); @Override void reset(); @Override long skip(long skip);  }
@Test public void testConstructor() { UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(_BUFFER); Assert.assertEquals(_SIZE, unsyncByteArrayInputStream.available()); unsyncByteArrayInputStream = new UnsyncByteArrayInputStream( _BUFFER, _SIZE / 2, _SIZE / 2); Assert.assertEquals(_SIZE / 2, unsyncByteArrayInputStream.available()); }