Exemple #1
0
 @Override
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   sender = in.readInt();
   eid = in.readInt();
   type = in.readInt();
   regency = in.readInt();
   leader = in.readInt();
   state = (ApplicationState) in.readObject();
   view = (View) in.readObject();
 }
Exemple #2
0
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   super.writeExternal(out);
   out.writeInt(sender);
   out.writeInt(eid);
   out.writeInt(type);
   out.writeInt(regency);
   out.writeInt(leader);
   out.writeObject(state);
   out.writeObject(view);
 }
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    super.writeExternal(out);

    out.writeInt(request.serializedMessage.length);
    out.write(request.serializedMessage);
    out.writeBoolean(request.signed);

    if (request.signed) {
      out.writeInt(request.serializedMessageSignature.length);
      out.write(request.serializedMessageSignature);
    }
  }
  @Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);

    byte[] serReq = new byte[in.readInt()];
    in.readFully(serReq);

    request = TOMMessage.bytesToMessage(serReq);
    request.serializedMessage = serReq;

    boolean signed = in.readBoolean();

    if (signed) {

      byte[] serReqSign = new byte[in.readInt()];
      in.readFully(serReqSign);
      request.serializedMessageSignature = serReqSign;
    }
  }