@Override
        public void writeObject(ByteBuffer buffer, Object object) throws IOException {
    
            // Add the null/non-null marker
            buffer.put( (byte)(object != null ? 0x1 : 0x0) );
            if (object == null) {
                // Nothing left to do
                return;
            }
            
            DisconnectMessage msg = (DisconnectMessage)object;
            StringSerializer.writeString( msg.reason, buffer );           
            StringSerializer.writeString( msg.type, buffer );           
        }
A message-specific serializer to avoid compatibility issues
 between versions.  This serializer is registered to the specific
 SERIALIZER_ID which is compatible with previous versions of the 
 SM serializer registrations... and now will be forever.
jme3-networking/src/main/java/com/jme3/network/message/DisconnectMessage.java