private static long doReadLong(ByteBuffer buffer, int length) throws IOException {
		long value = 0L;
		for (int i = 0; i < length; i++) {
			int b = buffer.get() & 0xFF;
			if ((i == 0) && ((b & 0x80) == 0x80)) {
				value = 0xFFFFFFFFL; // Negative, in two's complement form
			}
			value <<= 8;
			value |= b;
		}

		return value;
	}
private static long doReadLong(ByteBuffer buffer, int length) throws IOException {
		long value = 0L;
		for (int i = 0; i < length; i++) {
			int b = buffer.get() & 0xFF;
			if ((i == 0) && ((b & 0x80) == 0x80)) {
				value = 0xFFFFFFFFL; 
			}
			value <<= 8;
			value |= b;
		}

		return value;
	}
private static long doReadLong ( ByteBuffer buffer , int length ) throws IOException { long value = 0L ; for ( int i = 0 ; i < length ; i ++ ) { int b = buffer . get ( ) & 0xFF ; if ( ( i == 0 ) && ( ( b & 0x80 ) == 0x80 ) ) { value = 0xFFFFFFFF L ; // Negative, in two's complement form } value <<= 8 ; value |= b ; } return value ; }
TODO Check the OPAQUE UINT64 format
TODO Check the OPAQUE UINT64 format