code: public synchronized void updateLength(long length) {
      if (mLength == Constants.UNKNOWN_SIZE) {
        mLength = length;
      } else if (mLength != length) {
        LOG.warn("Attempting to update block length ({}) to a different length ({}).", mLength,
            length);
      }
    }
docs: Updates the length, if and only if the length was previously unknown.
  
  @param length the updated length