code: public long[] append(MessageSet messages) throws IOException {
          checkMutable();
          long written = 0L;
          while (written < messages.getSizeInBytes())
              written += messages.writeTo(channel, 0, messages.getSizeInBytes());
          long beforeOffset = setSize.getAndAdd(written);
          return new long[]{written, beforeOffset};
      }
docs: Append this message to the message set
  @param messages message to append
  @return the written size and first offset
  @throws IOException file write exception