boolean (byte @NotNull [] array, byte @NotNull [] prefix) { //noinspection ArrayEquality if (array == prefix) { return true; } int length = prefix.length; if (array.length < length) { return false; } for (int i = 0; i < length; i++) { if (array[i] != prefix[i]) { return false; } } return true; }