Re: [IOUtils] Possible bug in contentEquals(InputStream input1, InputStream input2)

2021-01-21 Thread Alex Herbert
You are looping over the streams twice. If you add an assertion error message you will find the failure is on the second iteration of the loop where the two streams on the second pass are equal as they both have no bytes left. You must take care to close your InputStreams after each use and reope

[IOUtils] Possible bug in contentEquals(InputStream input1, InputStream input2)

2021-01-21 Thread Singleton, Andrew (SanTech)
Hi, I was testing comparing some small input streams, looping through a list to see if a stream was already present and I got unexpected results. The bug can be recreated simply @Test void testCompare() throws Exception { byte[] b1 = new byte[]{'a','b','c'}; byte[] b2 = new byte[]{'d','