public void write(ObjectOutput out) throws IOException {
  if (csf == null) {
    out.writeByte(FORMAT_HOST_PORT);
    out.writeUTF(host);
    out.writeInt(port);
  }
 else {
    out.writeByte(FORMAT_HOST_PORT_FACTORY);
    out.writeUTF(host);
    out.writeInt(port);
    out.writeObject(csf);
  }
}

public void write ( ObjectOutput out ) throws IOException { if ( csf == null ) { out . writeByte ( FORMAT_HOST_PORT ) ; out . writeUTF ( host ) ; out . writeInt ( port ) ; } else { out . writeByte ( FORMAT_HOST_PORT_FACTORY ) ; out . writeUTF ( host ) ; out . writeInt ( port ) ; out . writeObject ( csf ) ; } }
write endpoint to output stream .
