public boolean onStringValue(ByteBuffer buffer, int size) {
            if (!buffer.isDirect()) {
                return onStringValue(buffer.array(), buffer.position(), size);
            }
            if (size > ColumnType.MAX_STRING_UTF8_SIZE) {
                logger.warn("string size overflow, expected less than {}, got {}", ColumnType.MAX_STRING_UTF8_SIZE, size);
                return false;
            }
            long addr = MemoryUtil.getAddress(buffer);
            int pos = buffer.position();
            boolean ok = onStringValue(addr + pos, size);
            buffer.position(pos + size);
            return ok;
        }
Take size of bytes from buffer and move forward pos.
indexr-segment/src/main/java/io/indexr/segment/rt/UTF8Row.java