### Question:
BinaryDecoder extends Decoder { @Override public int readInt() throws IOException { ensureBounds(5); int len = 1; int b = buf[pos] & 0xff; int n = b & 0x7f; if (b > 0x7f) { b = buf[pos + len++] & 0xff; n ^= (b & 0x7f) << 7; if (b > 0x7f) { b = buf[pos + len++] & 0xff; n ^= (b & 0x7f) << 14; if (b > 0x7f) { b = buf[pos + len++] & 0xff; n ^= (b & 0x7f) << 21; if (b > 0x7f) { b = buf[pos + len++] & 0xff; n ^= (b & 0x7f) << 28; if (b > 0x7f) { throw new InvalidNumberEncodingException("Invalid int encoding"); } } } } } pos += len; if (pos > limit) { throw new EOFException(); } return (n >>> 1) ^ -(n & 1); } 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 testEOFInt() throws IOException { newDecoderWithNoData().readInt(); }
@Test(expected = EOFException.class) public void testIntTooShort() throws IOException { byte[] badint = new byte[4]; Arrays.fill(badint, (byte) 0xff); newDecoder(badint).readInt(); }
@Test(expected = EOFException.class) public void testFloatTooShort() throws IOException { byte[] badint = new byte[3]; Arrays.fill(badint, (byte) 0xff); newDecoder(badint).readInt(); }