code: public static Buffer toBuffer(AbstractEvent event) throws IOException {
  		final ByteBuffer serializedEvent = EventSerializer.toSerializedEvent(event);
  
  		MemorySegment data = MemorySegmentFactory.wrap(serializedEvent.array());
  
  		final Buffer buffer = new NetworkBuffer(data, FreeingBufferRecycler.INSTANCE, false);
  		buffer.setSize(serializedEvent.remaining());
  
  		return buffer;
  	}
docs: ------------------------------------------------------------------------