code: public void addPiece(int piece, byte[] data, add_piece_flags_t flags) {
          th.add_piece_bytes(piece, Vectors.bytes2byte_vector(data), flags);
      }
docs: This function will write {@code data} to the storage as piece {@code piece},
  as if it had been downloaded from a peer. {@code data} is expected to
  point to a buffer of as many bytes as the size of the specified piece.
  The data in the buffer is copied and passed on to the disk IO thread
  to be written at a later point.
  <p>
  By default, data that's already been downloaded is not overwritten by
  this buffer. If you trust this data to be correct (and pass the piece
  hash check) you may pass the overwrite_existing flag. This will
  instruct libtorrent to overwrite any data that may already have been
  downloaded with this data.
  <p>
  Since the data is written asynchronously, you may know that is passed
  or failed the hash check by waiting for
  {@link com.frostwire.jlibtorrent.alerts.PieceFinishedAlert} or
  {@link com.frostwire.jlibtorrent.alerts.HashFailedAlert}.
  
  @param piece the piece index
  @param data  the piece data
  @param flags flags