code: private static boolean hasSameContent(final InputStream stream1, final InputStream stream2) throws IOException {
      int byte1 = -1;
      int byte2 = -1;
      do {
        byte1 = stream1.read();
        byte2 = stream2.read();
  
      } while (byte1 == byte2 && byte1 != -1);
      return byte1 == byte2;
    }
docs: Compare two input streams for duplicate content
  
  Naive implementation, but should not be performance issue.
  
  @param stream1
  stream
  @param stream2
  stream
  @return true if streams are identical in content
  @throws IOException
  if error reading streams