@Override
    public int compare(final ByteBuffer buffer1,
                       final int index1,
                       final ByteBuffer buffer2,
                       final int index2) {

        Objects.requireNonNull(buffer1);
        Objects.requireNonNull(buffer2);
        if (buffer1.remaining() != len) {
            throw new IllegalArgumentException(LogUtil.message("buffer1 has remaining {}, expecting {}",
                    buffer1.remaining(), len));
        }
        if (buffer2.remaining() != len) {
            throw new IllegalArgumentException(LogUtil.message("buffer2 has remaining {}, expecting {}",
                    buffer2.remaining(), len));
        }
        return Long.compare(
                get(buffer1, index1),
                get(buffer2, index2));
    }
Each instance provides methods for working with unsigned longs that are written
to len bytes. The maximum numeric value of the unsigned value will be governed
by len, e.g for len == 1, the range of values are 0-255.
stroom-lmdb/src/main/java/stroom/lmdb/serde/UnsignedBytesInstances.java