code: public void setChannelPosition(long dataOffset, long ckOffset)
        throws IOException {
      long channelSize = blockDataWriter.getChannelSize();
      if (channelSize < dataOffset) {
        String fileName;
        if (datanode.data instanceof FSDataset) {
          FSDataset fsDataset = (FSDataset) datanode.data;
          fileName = fsDataset.getDatanodeBlockInfo(namespaceId, block)
              .getBlockDataFile().getTmpFile(namespaceId, block).toString();
        } else {
          fileName = "unknown";
        }
        String msg = "Trying to change block file offset of block " + block
            + " file " + fileName + " 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 (dataOffset % bytesPerChecksum != 0 && channelSize != dataOffset) {
        DFSClient.LOG.warn("Non-inline Checksum Block " + block
            + " channel size " + channelSize + " but data starts from "
            + dataOffset);
      }
      blockDataWriter.position(dataOffset);
  
      setChecksumOffset(ckOffset);
    }
docs: Sets the offset in the block to which the the next write will write data
  to.