code: public OtpErlangPort read_port() throws OtpErlangDecodeException {
          String node;
          int id;
          int creation;
          int tag;
  
          tag = read1skip_version();
  
          if (tag != OtpExternal.portTag &&
  	    tag != OtpExternal.newPortTag) {
              throw new OtpErlangDecodeException(
                      "Wrong tag encountered, expected " + OtpExternal.portTag
  		    + " or " + OtpExternal.newPortTag
                              + ", got " + tag);
          }
  
          node = read_atom();
          id = read4BE();
  	if (tag == OtpExternal.portTag)
  	    creation = read1();
  	else
  	    creation = read4BE();
  
          return new OtpErlangPort(tag, node, id, creation);
      }
docs: Read an Erlang port from the stream.
  
  @return the value of the port.
  
  @exception OtpErlangDecodeException
  if the next term in the stream is not an Erlang port.