public static boolean equal ( Reader in1 , Reader in2 ) throws IOException { if ( in1 == in2 ) { return true ; } if ( in1 == null || in2 == null ) { return false ; } in1 = buffer ( in1 ) ; in2 = buffer ( in2 ) ; int c1 = in1 . read ( ) ; int c2 = in2 . read ( ) ; while ( c1 != - 1 && c2 != - 1 && c1 == c2 ) { c1 = in1 . read ( ) ; c2 = in2 . read ( ) ; } return in1 . read ( ) == - 1 && in2 . read ( ) == - 1 ; }
Returns whether the given streams have the same content .