code: public byte[] toByteArray() {
      byte[] copy = new byte[size];
      for (int i = 0; i < size; i++) {
        copy[i] = elements[i];
      }
      return copy;
    }
docs: Converts this <code>ByteArray</code> to an array of bytes.
  
  @return An array of bytes containing the same elements as this array.