docs: private static void skipToEnd(final ImageInputStream stream) throws IOException {
          if (stream.length() > 0) {
              // Seek to end of file
              stream.seek(stream.length());
          }
          else {
              // Skip to end
              long lastGood = stream.getStreamPosition();
  
              while (stream.read() != -1) {
                  lastGood = stream.getStreamPosition();
                  stream.skipBytes(1024);
              }
  
              stream.seek(lastGood);
  
              while (true) {
                  if (stream.read() == -1) {
                      break;
                  }
                  // Just continue reading to EOF...
              }
          }
      }