code: public void write_port(OtpErlangPort port) {
  	write1(port.tag());
  	write_atom(port.node());
  	write4BE(port.id());
  	switch (port.tag()) {
  	case OtpExternal.portTag:	    
  	    write1(port.creation());
  	    break;
  	case OtpExternal.newPortTag:
  	    write4BE(port.creation());
  	    break;
  	default:
  	    throw new AssertionError("Invalid port tag " + port.tag());
  	}
      }
docs: Write an Erlang port to the stream.
  
  @param port
  the port.