### Question:
BinaryDecoder extends Decoder { @Override public long readLong() throws IOException { ensureBounds(10); int b = buf[pos++] & 0xff; int n = b & 0x7f; long l; if (b > 0x7f) { b = buf[pos++] & 0xff; n ^= (b & 0x7f) << 7; if (b > 0x7f) { b = buf[pos++] & 0xff; n ^= (b & 0x7f) << 14; if (b > 0x7f) { b = buf[pos++] & 0xff; n ^= (b & 0x7f) << 21; if (b > 0x7f) { l = innerLongDecode((long) n); } else { l = n; } } else { l = n; } } else { l = n; } } else { l = n; } if (pos > limit) { throw new EOFException(); } return (l >>> 1) ^ -(l & 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 testEOFLong() throws IOException { newDecoderWithNoData().readLong(); }
@Test(expected = EOFException.class) public void testLongTooShort() throws IOException { byte[] badint = new byte[9]; Arrays.fill(badint, (byte) 0xff); newDecoder(badint).readLong(); }
@Test(expected = EOFException.class) public void testDoubleTooShort() throws IOException { byte[] badint = new byte[7]; Arrays.fill(badint, (byte) 0xff); newDecoder(badint).readLong(); }