docs: MappedByteBuffer map() {
      if (writer instanceof MappedJournalSegmentWriter) {
        return ((MappedJournalSegmentWriter<E>) writer).buffer();
      }
  
      try {
        JournalWriter<E> writer = this.writer;
        MappedByteBuffer buffer = channel.map(FileChannel.MapMode.READ_WRITE, 0, segment.descriptor().maxSegmentSize());
        this.writer = new MappedJournalSegmentWriter<>(buffer, segment, maxEntrySize, index, namespace);
        writer.close();
        return buffer;
      } catch (IOException e) {
        throw new StorageException(e);
      }
    }