code: private void setupResponse(ByteArrayOutputStream response, Call call, Status status, IOReadableWritable rv,
  			String errorClass, String error) throws IOException {
  		response.reset();
  		DataOutputStream out = new DataOutputStream(response);
  		out.writeInt(call.id); // write call id
  		out.writeInt(status.state); // write status
  
  		if (status == Status.SUCCESS) {
  			if (rv == null) {
  				out.writeBoolean(false);
  			} else {
  				out.writeBoolean(true);
  				StringRecord.writeString(out, rv.getClass().getName());
  				rv.write(out);
  			}
  
  		} else {
  			StringRecord.writeString(out, errorClass);
  			StringRecord.writeString(out, error);
  		}
  		call.setResponse(ByteBuffer.wrap(response.toByteArray()));
  	}
docs: Setup response for the IPC Call.
  
  @param response
  buffer to serialize the response into
  @param call
  {@link Call} to which we are setting up the response
  @param status
  {@link Status} of the IPC call
  @param rv
  return value for the IPC Call, if the call was successful
  @param errorClass
  error class, if the the call failed
  @param error
  error message, if the call failed
  @throws IOException