code: private void setCapacity(int len, boolean keepData) {
          if (bytes == null || bytes.length < len) {
              byte[] newBytes = new byte[len];
              if (bytes != null && keepData) {
                  System.arraycopy(bytes, 0, newBytes, 0, length);
              }
              bytes = newBytes;
          }
      }
docs: /*
  Sets the capacity of this Text object to <em>at least</em>
  <code>len</code> bytes. If the current buffer is longer,
  then the capacity and existing content of the buffer are
  unchanged. If <code>len</code> is larger
  than the current capacity, the Text object's capacity is
  increased to match.
  @param len the number of bytes we need
  @param keepData should the old data be kept