code: @Override
      public void write(long offset, ByteBuffer sourceBuffer) throws IOException {
          offset += contentStart;
          sourceBuffer.position(0);
  
          long newFilePosition = offset + sourceBuffer.limit();
          if (newFilePosition > contentEnd) {
              logger.debug("Filesize exceeded (contendEnd: {},size: {})", contentEnd, size);
              if (AUTO_ENLARGE) {
                  // if the incrementSize is not large enough
                  // if (offset + sourceBuffer.limit() > contentEnd + incrementSize) {
                  // incrementSize = (int) (offset + sourceBuffer.limit() - contentEnd + incrementSize);
                  // }
                  this.enlargeFile(newFilePosition - contentEnd);
              } else {
                  throw new IOException("Filesize exceeded (" + size
                          + ") and automatic enlargement is disabled. You have to enlarge file manually.");
              }
          }
  
          if (offset + sourceBuffer.limit() > filledUpTo) {
              filledUpTo = offset + sourceBuffer.limit();
          }
          channel.write(sourceBuffer, offset);
          writeHeader();
      }
docs: writes the bytes from the given ByteBuffer to the file beginning at offset. The size of the HEADER will be
  respected automatically.
  
  @param offset
  @param sourceBuffer
  @throws IOException