code: public boolean isUnderConstructionBlock(Block block) {
      if (!isUnderConstruction()) {
        return false;
      }
      LocatedBlock lastBlock = this.get(this.locatedBlockCount() - 1);
  
      // There are potential inconsistency when counting the size of the
      // last block, but fileLength is not likely to be under-estimated
      // the size, unless the last block size is 0. 
      if ((this.fileLength <= lastBlock.getStartOffset()
          + lastBlock.getBlockSize())
          && lastBlock.getBlock().equals(block)) {
        return true;
      }
      return false;
    }
docs: Determine whether the input block is the block under-construction
  for the file. If the current file is not under-construction, always
  false is returned.
  
  The result is the best guess based on unknown
  information. The bottom line is, when the position equals to file length,
  the block selected will be return true. This has to be guaranteed to make
  sure the available size updating logic will always be triggered when
  reading to the end of a under-construction file.
  
  @param block
  @return