code: @Override
      public void writeExternal(final ObjectOutput out) throws IOException
      {
          // Name of the event
          final byte[] eventNameBytes = eventName.getBytes(NAME_CHARSET);
          out.writeInt(eventNameBytes.length);
          out.write(eventNameBytes);
  
          final byte[] payloadBytes = getSerializedEvent();
  
          // Size of Smile payload. Needed for deserialization, see below
          out.writeInt(payloadBytes.length);
  
          out.write(payloadBytes);
      }
docs: The object implements the writeExternal method to save its contents
  by calling the methods of DataOutput for its primitive values or
  calling the writeObject method of ObjectOutput for objects, strings,
  and arrays.
  
  @param out the stream to write the object to
  @throws java.io.IOException Includes any I/O exceptions that may occur
  @serialData Overriding methods should use this tag to describe
  the data layout of this Externalizable object.
  List the sequence of element types and, if possible,
  relate the element to a public/protected field and/or
  method of this Externalizable class.