mayi-common/mayi-common-core/src/main/java/com/zf1976/mayi/common/core/util/ByteUtils.java
public static void toLittleEndian(final ByteConsumer consumer, final long value, final int length)
            throws IOException {
        long num = value;
        for (int i = 0; i < length; i++) {
            consumer.accept((int) (num & 0xff));
            num >>= 8;
        }
    }
/**
     * Provides the given value to the given consumer as a little endian
     * sequence of the given length.
     *
     * @param consumer the consumer to provide the bytes to
     * @param value    the value to provide
     * @param length   the number of bytes to use to represent the value
     * @throws IOException if writing fails
     */
Provides the given value to the given consumer as a little endian
sequence of the given length.

@param consumer the consumer to provide the bytes to
@param value    the value to provide
@param length   the number of bytes to use to represent the value
@throws IOException if writing fails
Provides the given value to the given consumer as a little endian sequence of the given length . @param consumer the consumer to provide the bytes to @param value the value to provide @param length the number of bytes to use to represent the value @throws IOException if writing fails
public static void toLittleEndian(final ByteConsumer consumer, final long value, final int length)
            throws IOException {
        long num = value;
        for (int i = 0; i < length; i++) {
            consumer.accept((int) (num & 0xff));
            num >>= 8;
        }
    }
public static void toLittleEndian ( final ByteConsumer consumer , final long value , final int length ) throws IOException { long num = value ; for ( int i = 0 ; i < length ; i ++ ) { consumer . accept ( ( int ) ( num & 0xff ) ) ; num >>= 8 ; } }
Provides the given value to the given consumer as a little endian
 sequence of the given length.
Provides the given value to the given consumer as a little endian sequence of the given length .