code: public ByteBuffer read(long offset, int length, ByteBuffer block)
            throws IllegalArgumentException, IllegalStateException, IOException {
      if (!this.valid) {
        throw new IllegalStateException("Attempting to read an " +
                "known-to-be invalid piece!");
      }
  
      return this._read(offset, length, block);
    }
docs: Read a piece block from the underlying byte storage.
  
  <p>
  This is the public method for reading this piece's data, and it will
  only succeed if the piece is complete and valid on disk, thus ensuring
  any data that comes out of this function is valid piece data we can send
  to other peers.
  </p>
  
  @param offset Offset inside this piece where to start reading.
  @param length Number of bytes to read from the piece.
  @return A byte buffer containing the piece data.
  @throws IllegalArgumentException If <em>offset + length</em> goes over
  the piece boundary.
  @throws IllegalStateException    If the piece is not valid when attempting
  to read it.
  @throws IOException              If the read can't be completed (I/O error, or EOF
  reached, which can happen if the piece is not complete).