private final static Integer readInt(final InputStream in,
			final IntegerPointer iPtr) throws IOException {
		int value = 0;
		while (true) {
			final int byteRead = in.read();
			iPtr.decrement();
			if (byteRead < 0) {
				throw new IOException("Unexpected end of file");
			}
			value <<= 7;
			value += 0x7f & byteRead;
			if ((byteRead & 0x80) == 0) {
				break;
			}
		}
		return Integer.valueOf(value);
	}