private static RationalNumber toRational(final byte[] bytes, final int offset, final ByteOrder byteOrder, final boolean unsignedType) {
        final int byte0 = 0xff & bytes[offset + 0];
        final int byte1 = 0xff & bytes[offset + 1];
        final int byte2 = 0xff & bytes[offset + 2];
        final int byte3 = 0xff & bytes[offset + 3];
        final int byte4 = 0xff & bytes[offset + 4];
        final int byte5 = 0xff & bytes[offset + 5];
        final int byte6 = 0xff & bytes[offset + 6];
        final int byte7 = 0xff & bytes[offset + 7];
        final int numerator;
        final int divisor;
        if (byteOrder == ByteOrder.BIG_ENDIAN) {
            numerator = byte0 << 24 | byte1 << 16 | byte2 << 8 | byte3;
            divisor = byte4 << 24 | byte5 << 16 | byte6 << 8 | byte7;
        } else {
            numerator = byte3 << 24 | byte2 << 16 | byte1 << 8 | byte0;
            divisor = byte7 << 24 | byte6 << 16 | byte5 << 8 | byte4;
        }
        return new RationalNumber(numerator, divisor, unsignedType);
    }
Interprets the content of a specified bytes array to create an instance of the RationalNumber class.

@param bytes        a valid array dimensioned to at least 8.
@param byteOrder    the byte order for integer conversion
@param unsignedType indicates whether the extracted value is an unsigned type.
@return a valid instance
src/main/java/org/apache/commons/imaging/common/ByteConversions.java