I'm using the following to compare the content of two supposedly identical files. I've read that—at least with respect to textual files, like TXT or HTML—the encoding of a file affects how a file's hexadecimal-sequence is translated into characters: i.e., for the same hexadecimal-sequence, a file encoded in UTF-8 will display different content to one encoded in ASCII. Does file-encoding affect my code below at all? or does it not, as I am comparing the files' contents at the basic level of bytes, whereat hexadecimal-sequences are not concerned?
Edit: I'm using this code to compare two supposedly identical files of any file type and of any file size.
bin_1 = new BufferedInputStream(file_input_stream_1); bin_2 = new BufferedInputStream(file_input_stream_2);byte[] barr_1 = new byte[8192];byte[] barr_2 = new byte[8192]; while(bin_1.available() > 0){ bin_1.read(barr_1); bin_2.read(barr_2); if(Arrays.equals(barr_1, barr_2) == false){ break; } else{ barr_1 = new byte[8192]; barr_2 = new byte[8192]; continue; }}