src/main/java/org/jcodec/algo/DataConvert.java
public static byte[] toByte(int[] ia, int depth, boolean isBe) {
        if (depth == 24)
            if (isBe)
                return to24BE(ia);
            else
                return to24LE(ia);
        else if (depth == 16)
            if (isBe)
                return to16BE(ia);
            else
                return to16LE(ia);
        throw new NotSupportedException("Conversion to " + depth + "bit " + (isBe ? "big endian" : "little endian")
                + " is not supported.");
    }
public static byte[] toByte(int[] ia, int depth, boolean isBe) {
        if (depth == 24)
            if (isBe)
                return to24BE(ia);
            else
                return to24LE(ia);
        else if (depth == 16)
            if (isBe)
                return to16BE(ia);
            else
                return to16LE(ia);
        throw new NotSupportedException("Conversion to " + depth + "bit " + (isBe ? "big endian" : "little endian")
                + " is not supported.");
    }
public static byte [ ] toByte ( int [ ] ia , int depth , boolean isBe ) { if ( depth == 24 ) if ( isBe ) return to24BE ( ia ) ; else return to24LE ( ia ) ; else if ( depth == 16 ) if ( isBe ) return to16BE ( ia ) ; else return to16LE ( ia ) ; throw new NotSupportedException ( "Conversion to " + depth + "bit " + ( isBe ? "big endian" : "little endian" ) + " is not supported." ) ; }
Generic integer-array to byte-array conversion

Converts each integer into depth-bit sequence in the output byte array

@param ia
Integer array
@param depth
Bit depth of the integers
@param isBe
If integers are big-endian or little-endian
@return
Generic integer - array to byte - array conversion