public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { int len=in.readUnsignedByte(); if(len > 0) { byte[] a = new byte[len]; in.readFully(a); this.ip_addr=InetAddress.getByAddress(a); } //then read the port port=in.readUnsignedShort(); // GemStoneAddition - process id, etc processId = in.readInt(); directPort = in.readInt(); vmKind = in.readByte(); birthViewId = in.readInt(); name = in.readUTF(); len=in.readInt(); if(len > 0) { additional_data=new byte[len]; in.readFully(additional_data, 0, additional_data.length); } int flags = in.readUnsignedByte(); // GemStoneAddition setFlags(flags); readVersion(flags, in); // GemStoneAddition }
/** * For Externalizable * * @see java.io.Externalizable */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { // ipAddr = new IpAddress(); // ipAddr.readExternal(in); // do it the way we like int len = in.readInt(); // IPv6 compatible byte addr[] = new byte[len]; in.readFully(addr); InetAddress ia = InetAddress.getByAddress(addr); int port = in.readInt(); byte flags = in.readByte(); ipAddr = new IpAddress(ia, port); ipAddr.setFlags(flags); ipAddr.readVersion(flags, in); len = in.readInt(); if (len != 0) { byte bytes[] = new byte[len]; in.readFully(bytes); GFJGBasicAdapter.insertGemFireAttributes(ipAddr, new MemberAttributes(bytes)); } }
public void setPort(int p) { IpAddress i = new IpAddress(ipAddr.getIpAddress(), p); i.setFlags(ipAddr.getFlags()); i.setVmKind(ipAddr.getVmKind()); i.setDirectPort(ipAddr.getDirectPort()); i.setProcessId(ipAddr.getProcessId()); i.setRoles(ipAddr.getRoles()); i.setDurableClientAttributes(ipAddr.getDurableClientAttributes()); i.setVersionOrdinal(ipAddr.getVersionOrdinal()); this.ipAddr = i; } }