@Override
    public int compareTo(RawBuffer rhs) {
        Byte[] my = buffer.toArray(new Byte[0]);
        Byte[] their = rhs.buffer.toArray(new Byte[0]);
        for (int i = 0; i < my.length && i < their.length; i++) {
            if (my[i] < their[i]) {
                return -1;
            } else if (my[i] > their[i]) {
                return 1;
            }
        }
        return Integer.compare(my.length, their.length);
    }
Create a copy of data in the internal buffer.

@return A copy of the data.
container-search/src/main/java/com/yahoo/search/grouping/request/RawBuffer.java