code: public Observable<ServiceResponseWithHeaders<Void, RecognizeTextInStreamHeaders>> recognizeTextInStreamWithServiceResponseAsync(byte[] image, TextRecognitionMode mode) {
          if (this.client.endpoint() == null) {
              throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
          }
          if (image == null) {
              throw new IllegalArgumentException("Parameter image is required and cannot be null.");
          }
          if (mode == null) {
              throw new IllegalArgumentException("Parameter mode is required and cannot be null.");
          }
          String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint());
          RequestBody imageConverted = RequestBody.create(MediaType.parse("application/octet-stream"), image);
          return service.recognizeTextInStream(imageConverted, mode, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
              .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<Void, RecognizeTextInStreamHeaders>>>() {
                  @Override
                  public Observable<ServiceResponseWithHeaders<Void, RecognizeTextInStreamHeaders>> call(Response<ResponseBody> response) {
                      try {
                          ServiceResponseWithHeaders<Void, RecognizeTextInStreamHeaders> clientResponse = recognizeTextInStreamDelegate(response);
                          return Observable.just(clientResponse);
                      } catch (Throwable t) {
                          return Observable.error(t);
                      }
                  }
              });
      }
docs: Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operation.
  
  @param image An image stream.
  @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed'
  @throws IllegalArgumentException thrown if parameters fail the validation
  @return the {@link ServiceResponseWithHeaders} object if successful.