code: @Override
      public void write(long offset, ByteBuffer srcBuf)
              throws ReadOnlyException, IOException {
  
          checkWritable();
  
          updateTimeStamps(true);
          
          final long lastByte = offset + srcBuf.remaining();
  
          if (lastByte > getLength()) {
              setLength(lastByte);
          }
          
          chain.writeData(offset, srcBuf);
      }
docs: <p>
  {@inheritDoc}
  </p><p>
  If the data to be written extends beyond the current
  {@link #getLength() length} of this file, an attempt is made to
  {@link #setLength(long) grow} the file so that the data will fit.
  Additionally, this method updates the "last accessed" and "last modified"
  fields on the directory entry that is associated with this file.
  </p>
  
  @param offset {@inheritDoc}
  @param srcBuf {@inheritDoc}