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