code: public long append(Entry entry) {
      Assert.notNull(entry, "entry");
      assertIsOpen();
  
      // Append the entry to the appropriate segment.
      long index = currentSegment().append(entry);
      entryBuffer.append(entry);
      return index;
    }
docs: Appends an entry to the log.
  
  @param entry The entry to append.
  @return The appended entry index.
  @throws IllegalStateException If the log is not open
  @throws NullPointerException If {@code entry} is {@code null}
  @throws IndexOutOfBoundsException If the entry's index does not match the expected next log index.