code: public void setChannelPosition(long dataOffset, boolean startWithPartialChunk)
        throws IOException {
      long channelSize = blockDataWriter.getChannelSize();
      if (channelSize < dataOffset) {
        String msg = "Trying to change block file offset of block "
            + block
            + "file "
            + ((blockDataFile.getFile() != null) ? blockDataFile.getFile()
                : "unknown") + " to " + dataOffset
            + " but actual size of file is " + blockDataWriter.getChannelSize();
        throw new IOException(msg);
      }
      if (dataOffset > channelSize) {
        throw new IOException("Set position over the end of the data file.");
      }
      
      if (startWithPartialChunk && channelSize != dataOffset + checksumSize) {
        DFSClient.LOG.warn("Inline Checksum Block " + block + " channel size "
            + channelSize + " but packet needs to start from " + dataOffset);
      }
      
      // This flush should be a no-op since we always flush at the end of
      // writePacket() and hence the buffer should be empty.
      // However we do this just to be extra careful so that the
      // channel.position() doesn't mess up things with respect to the
      // buffered dataOut stream.
      blockDataWriter.flush();
      blockDataWriter.position(dataOffset);
    }
docs: Sets the offset in the block to which the the next write will write data
  to.