private byte[] splitKeyAlgorithm(byte[] key) {
var splitStream = 55;
for (int i = 0, x = 0; i < key.length; i++, x++) {
if (x == splitStream) {
key[i] = '\n';
x = -1;
}
}
return key;
}
I want to split array of bytes to print into this same length line by new line byte '\n'(splitStream). My question is: I have elegant splitted byte array on the screen but what does with element represented by key[i] ? Is overwritten by '\n'? Its impossible because i do:
Arrays.compare(original byte[], splitted byte[]);
Arrays.mismatch(original byte[], splitted byte[]);
Above codes return that this two arrays are equals and don't have any mismatch.
Edit:// Comparing looks like this:
Arrays.compare(List<ByteArrayOutputStream>outputStream.get(0).toByteArray(), primitive byte[] array);
\n. If there was no\nat that place before (which it wasn't, because\nis10and not55), the two arrays are not equal (unless they are both empty).