MCPcopy Create free account
hub / github.com/belaban/JGroups / writeTo

Method writeTo

src/org/jgroups/stack/IpAddress.java:137–150  ·  view source on GitHub ↗
(DataOutput out)

Source from the content-addressed store, hash-verified

135 }
136
137 @Override
138 public void writeTo(DataOutput out) throws IOException {
139 if(ip_addr != null) {
140 byte[] address=ip_addr.getAddress(); // 4 bytes (IPv4) or 16 bytes (IPv6)
141 out.writeByte(address.length); // 1 byte
142 out.write(address, 0, address.length);
143 if(ip_addr instanceof Inet6Address)
144 out.writeInt(((Inet6Address)ip_addr).getScopeId());
145 }
146 else {
147 out.writeByte(0);
148 }
149 out.writeShort(port);
150 }
151
152 @Override
153 public void readFrom(DataInput in) throws IOException {

Callers 5

testRead2Method · 0.95
testRead3Method · 0.95
testStreamableMethod · 0.95

Calls 5

getAddressMethod · 0.45
writeByteMethod · 0.45
writeMethod · 0.45
writeIntMethod · 0.45
writeShortMethod · 0.45

Tested by 5

testRead2Method · 0.76
testRead3Method · 0.76
testStreamableMethod · 0.76