mayi-common/mayi-common-core/src/main/java/com/zf1976/mayi/common/core/util/ByteUtils.java
public static void toLittleEndian(final DataOutput out, final long value, final int length)
            throws IOException {
        // somewhat duplicates the ByteConsumer version in order to save the creation of a wrapper object
        long num = value;
        for (int i = 0; i < length; i++) {
            out.write((int) (num & 0xff));
            num >>= 8;
        }
    }
/**
     * Writes the given value to the given stream as a little endian
     * array of the given length.
     *
     * @param out    the output to write to
     * @param value  the value to write
     * @param length the number of bytes to use to represent the value
     * @throws IOException if writing fails
     */
Writes the given value to the given stream as a little endian
array of the given length.

@param out    the output to write to
@param value  the value to write
@param length the number of bytes to use to represent the value
@throws IOException if writing fails
Writes the given value to the given stream as a little endian array of the given length . @param out the output to write to @param value the value to write @param length the number of bytes to use to represent the value @throws IOException if writing fails
public static void toLittleEndian(final DataOutput out, final long value, final int length)
            throws IOException {
        long num = value;
        for (int i = 0; i < length; i++) {
            out.write((int) (num & 0xff));
            num >>= 8;
        }
    }
public static void toLittleEndian ( final DataOutput out , final long value , final int length ) throws IOException { long num = value ; for ( int i = 0 ; i < length ; i ++ ) { out . write ( ( int ) ( num & 0xff ) ) ; num >>= 8 ; } }
Writes the given value to the given stream as a little endian
 array of the given length.
Writes the given value to the given stream as a little endian array of the given length .
// somewhat duplicates the ByteConsumer version in order to save the creation of a wrapper object