Exemplo n.º 1
0
 public Message getMessage(Integer version) throws IOException {
   DataOutputBuffer dob = new DataOutputBuffer();
   serializer.serialize(this, dob, version);
   return new Message(
       FBUtilities.getBroadcastAddress(),
       StorageService.Verb.RANGE_SLICE,
       Arrays.copyOf(dob.getData(), dob.getLength()),
       version);
 }
Exemplo n.º 2
0
 public static RangeSliceCommand read(Message message) throws IOException {
   byte[] bytes = message.getMessageBody();
   FastByteArrayInputStream bis = new FastByteArrayInputStream(bytes);
   return serializer.deserialize(new DataInputStream(bis), message.getVersion());
 }