ByteArrayDataInput extends InputStream implements DataInput, VersionedDataStream { @Override public void readFully(byte[] b) throws IOException { readFully(b, 0, b.length); } ByteArrayDataInput();  ByteArrayDataInput(byte[] bytes);  ByteArrayDataInput(byte[] bytes, KnownVersion version); void initialize(byte[] bytes, KnownVersion version); @Override KnownVersion getVersion(); @Override int read(); @Override int read(byte[] b, int off, int len); @Override long skip(long n); @Override int available(); int position(); void setPosition(int pos); @Override void readFully(byte[] b); @Override void readFully(byte[] b, int off, int len); @Override int skipBytes(int n); @Override boolean readBoolean(); @Override byte readByte(); @Override int readUnsignedByte(); @Override short readShort(); @Override int readUnsignedShort(); @Override char readChar(); @Override int readInt(); @Override long readLong(); @Override float readFloat(); @Override double readDouble(); @Override String readUTF(); @Override String readLine(); @Override void close(); @Override String toString();  }
@Test public void readFullyThatReadsPastEndOfDataThrowsEOFException() throws IOException { byte[] inputBytes = new byte[1]; DataInput input = createDataInput(inputBytes); byte[] outputBytes = new byte[2]; Throwable t = catchThrowable(() -> input.readFully(outputBytes)); assertThat(t).isInstanceOf(EOFException.class); }