code: private static void displayTextInputStream(InputStream input) throws IOException {
          BufferedReader reader = new BufferedReader(new InputStreamReader(input));
          while (true) {
              String line = reader.readLine();
              if (line == null) break;
  
              System.out.println("    " + line);
          }
          System.out.println();
      }
docs: Displays the contents of the specified input stream as text.
  
  @param input
  The input stream to display as text.
  
  @throws IOException