docs: public static void rotatePage(ImageInputStream imageInput, ImageOutputStream imageOutput, int degree, int pageIndex)
              throws IOException {
          ImageInputStream input = null;
          try {
              List<TIFFPage> pages = getPages(imageInput);
              if (pageIndex != -1) {
                  pages.get(pageIndex).rotate(degree);
              }
              else {
                  for (TIFFPage tiffPage : pages) {
                      tiffPage.rotate(degree);
                  }
              }
              writePages(imageOutput, pages);
          }
          finally {
              if (input != null) {
                  input.close();
              }
          }
      }