code: public void setText(Text result, int offset, int length) {
      result.clear();
      result.set(data.getBytes(), offset, length);
    }
docs: Set a text value from the bytes in this dynamic array.
  @param result the value to set
  @param offset the start of the bytes to copy
  @param length the number of bytes to copy