static void setMedium(byte[] memory, int index, int value) {
        memory[index] = (byte) (value >>> 16);
        memory[index + 1] = (byte) (value >>> 8);
        memory[index + 2] = (byte) value;
    }
Utility class for heap buffers.

Forked from <a href="https://github.com/netty/netty">Netty</a>.
jraft-core/src/main/java/com/alipay/sofa/jraft/util/HeapByteBufUtil.java