code: public ByteArrayWrapper ensureCapacity(int capacity) 
      {
          if (bytes == null || bytes.length < capacity) {
              byte[] newbytes = new byte[capacity];
              if (bytes != null) {
                  copyBytes(bytes, 0, newbytes, 0, size);
              }
              bytes = newbytes;
          }
          return this;
      }
docs: Ensure that the internal byte array is at least of length capacity.
  If the byte array is null or its length is less than capacity, a new
  byte array of length capacity will be allocated.
  The contents of the array (between 0 and size) remain unchanged.
  @param capacity minimum length of internal byte array.
  @return this ByteArrayWrapper