### Question:
BinaryDecoder extends Decoder { @Override public ByteBuffer readBytes(ByteBuffer old) throws IOException { int length = readInt(); final ByteBuffer result; if (old != null && length <= old.capacity()) { result = old; ((Buffer) result).clear(); } else { result = ByteBuffer.allocate(length); } doReadBytes(result.array(), result.position(), length); ((Buffer) result).limit(length); return result; } protected  BinaryDecoder();   BinaryDecoder(InputStream in, int bufferSize);   BinaryDecoder(byte[] data, int offset, int length); @Override void readNull(); @Override boolean readBoolean(); @Override int readInt(); @Override long readLong(); @Override float readFloat(); @Override double readDouble(); @Override Utf8 readString(Utf8 old); @Override String readString(); @Override void skipString(); @Override ByteBuffer readBytes(ByteBuffer old); @Override void skipBytes(); @Override void readFixed(byte[] bytes, int start, int length); @Override void skipFixed(int length); @Override int readEnum(); @Override long readArrayStart(); @Override long arrayNext(); @Override long skipArray(); @Override long readMapStart(); @Override long mapNext(); @Override long skipMap(); @Override int readIndex(); boolean isEnd(); InputStream inputStream();  }### Answer:
@Test(expected = EOFException.class) public void testEOFBytes() throws IOException { newDecoderWithNoData().readBytes(null); }