예제 #1
0
 public static View deserialiseView(ByteBuf buf) {
   int id = buf.readInt();
   int memsize = buf.readInt();
   ImmutableSortedSet.Builder<Address> addrs = ImmutableSortedSet.naturalOrder();
   for (int i = 0; i < memsize; i++) {
     Address addr = (Address) AddressSerializer.INSTANCE.fromBinary(buf, Optional.absent());
     addrs.add(addr);
   }
   return new View(addrs.build(), id);
 }
예제 #2
0
 public static Address deserialiseAddress(byte[] data) {
   ByteBuf buf = Unpooled.wrappedBuffer(data);
   Address addr = (Address) AddressSerializer.INSTANCE.fromBinary(buf, Optional.absent());
   buf.release();
   return addr;
 }