contractSerializer.write(request.serviceId, writer);
contractSerializer.write(request.methodId, writer);
contractSerializer.write((request.arguments == null) ? NO_ARGUMENTS : Arrays.asList(request.arguments), writer);
} else if (message instanceof ValueReply) {
writer.writeByte(VALUE_REPLY);
final ValueReply reply = (ValueReply)message;
contractSerializer.write(reply.value, writer);
} else {
writer.writeByte(EXCEPTION_REPLY);
final ExceptionReply reply = (ExceptionReply)message;
contractSerializer.write(reply.throwable, writer);