public int encode(ByteBuffer buffer) {
        var serialForm = toSerialForm();
        var b = serialForm.getBytes(StandardCharsets.UTF_8);
        buffer.put(b);
        return b.length;
    }
Returns the field orders of this sort specification as list. This is never null but can be empty.
This list can be modified to change this sort spec.
container-search/src/main/java/com/yahoo/search/query/Sorting.java