public static long readLong(final DataInput in) throws IOException {
		int b = in.readByte() & 0xFF;
		int n = b & 0x7F;
		long l;
		if (b > 0x7F) {
			b = in.readByte() & 0xFF;
			n ^= (b & 0x7F) << 7;
			if (b > 0x7F) {
				b = in.readByte() & 0xFF;
				n ^= (b & 0x7F) << 14;
				if (b > 0x7F) {
					b = in.readByte() & 0xFF;
					n ^= (b & 0x7F) << 21;
					l = b > 0x7F ? innerLongDecode(n, in) : n;
				} else {
					l = n;
				}
			} else {
				l = n;
			}
		} else {
			l = n;
		}
		return (l >>> 1)^-(l & 1);
	}
Reads a long value from the given data input. The integer value must have
been written by the {@link #writeInt(int, DataOutput)} before.

@see #writeLong(long, DataOutput)

@param in the data input where the integer value is read from
@return the read long value
@throws NullPointerException if the given data input is {@code null}
@throws IOException if an I/O error occurs
jenetics/src/main/java/io/jenetics/internal/util/SerialIO.java