public final int read4ByteInteger(String exception)
            throws ImageReadException, IOException
    {
        int byte0 = is.read();
        int byte1 = is.read();
        int byte2 = is.read();
        int byte3 = is.read();
        if (byte0 < 0 || byte1 < 0 || byte2 < 0 || byte3 < 0)
            throw new ImageReadException(exception);

        if (byteOrder == BYTE_ORDER_MOTOROLA) // motorola, big endian
            return ((0xff & byte0) << 24) + ((0xff & byte1) << 16)
                    + ((0xff & byte2) << 8) + ((0xff & byte3) << 0);
        else
            // intel, little endian
            return ((0xff & byte3) << 24) + ((0xff & byte2) << 16)
                    + ((0xff & byte1) << 8) + ((0xff & byte0) << 0);
    }