code: protected void grow(int index) {
      if ((index * literalSize) + (literalSize - 1) >= data.length()) {
        int newSize = Math.max((index * literalSize) + defaultSize, 2 * data.length());
        Slice newSlice = Slices.allocate(newSize);
        newSlice.setBytes(0, data);
        setData(newSlice);
      }
    }
docs: Ensure that the given index is valid.