code: private Response save(Response response) {
          String jsonBody;
          String key = response.request().url().toString();
  
          log("----- SAVE FOR OFFLINE : saving starts");
          log("---------- for request : " + key);
          log("---------- trying to parse response body");
  
          //Try to get response body
          BufferedReader reader;
          StringBuilder sb = new StringBuilder();
          log("---------- trying to parse response body");
          InputStream bodyStream = response.body().byteStream();
          InputStreamReader bodyReader = new InputStreamReader(bodyStream, Charset.forName("UTF-8"));
          reader = new BufferedReader(bodyReader);
          String line;
          try {
              while ((line = reader.readLine()) != null) {
                  sb.append(line);
              }
              bodyReader.close();
              bodyReader.close();
              reader.close();
          } catch (IOException e) {
              Log.e(TAG, "IOException : " + e.getMessage());
          }
  
  
          jsonBody = sb.toString();
  
  
          log("---------- trying to save response body for offline");
  
          mCacheQueryHandler.put(key, jsonBody);
  
          log("---------- url : " + key);
          log("---------- body : " + jsonBody);
          log("----- SAVE FOR OFFLINE : saving ends");
  
          return response.newBuilder().body(ResponseBody.create(response.body().contentType(), jsonBody)).build();
      }
docs: Allow to save the Response body for offline usage.
  
  @param response response to save