@Test public void isReadable() { assertFalse(new BaseByteArrayReader(null, posReader, lenReader).isReadable()); assertFalse(new BaseByteArrayReader(dataReader, null, lenReader).isReadable()); assertFalse(new BaseByteArrayReader(dataReader, posReader, null).isReadable()); assertFalse(new BaseByteArrayReader(dataReader, posReader, lenReader).isReadable()); when(dataReader.isReadable()).thenReturn(true); assertFalse(new BaseByteArrayReader(dataReader, posReader, lenReader).isReadable()); when(posReader.isReadable()).thenReturn(true); assertFalse(new BaseByteArrayReader(dataReader, posReader, lenReader).isReadable()); when(lenReader.isReadable()).thenReturn(true); assertTrue(new BaseByteArrayReader(dataReader, posReader, lenReader).isReadable()); }
@Override public boolean isReadable() { return dataReader != null && dataReader.isReadable() && posReader != null && posReader.isReadable() && lenReader != null && lenReader.isReadable(); }
BaseByteArrayReader implements ByteArrayReader { @Override public boolean isReadable() { return dataReader != null && dataReader.isReadable() && posReader != null && posReader.isReadable() && lenReader != null && lenReader.isReadable(); } }
BaseByteArrayReader implements ByteArrayReader { @Override public boolean isReadable() { return dataReader != null && dataReader.isReadable() && posReader != null && posReader.isReadable() && lenReader != null && lenReader.isReadable(); } BaseByteArrayReader(ByteReader dataReader, LongReader posReader, IntReader lenReader); }
BaseByteArrayReader implements ByteArrayReader { @Override public boolean isReadable() { return dataReader != null && dataReader.isReadable() && posReader != null && posReader.isReadable() && lenReader != null && lenReader.isReadable(); } BaseByteArrayReader(ByteReader dataReader, LongReader posReader, IntReader lenReader); @Override boolean isReadable(); @Override byte[] get(long pos); @Override InputStream getStream(long pos); @Override void release(); }
BaseByteArrayReader implements ByteArrayReader { @Override public boolean isReadable() { return dataReader != null && dataReader.isReadable() && posReader != null && posReader.isReadable() && lenReader != null && lenReader.isReadable(); } BaseByteArrayReader(ByteReader dataReader, LongReader posReader, IntReader lenReader); @Override boolean isReadable(); @Override byte[] get(long pos); @Override InputStream getStream(long pos); @Override void release();  }