Fast way to compare inputstreams

后端 未结 4 2066

I have a problem, I need to compare two inputstreams fast.

Today I have a function like this:

private boolean isEqual(InputStream i1, InputStream i2) thr         


        
4条回答
  •  春和景丽
    2021-02-05 05:37

    By far my favorite is to use the org.apache.commons.io.IOUtils helper class from the Apache Commons IO library:

    IOUtils.contentEquals( is1, is2 );
    

提交回复
热议问题