Учитывая массив байтов, как я могу найти в нем положение (меньшего) байтового массива?
Эта документация выглядела многообещающей, используя ArrayUtils
, но если я прав, это позволит мне найти отдельный байт в массиве, который нужно искать.
(Я не вижу в этом никакого значения, но на всякий случай: иногда массив байтов поиска будет регулярным символом ASCII, иначе он будет управляющими символами или расширенными символами ASCII, поэтому использование операций со строками не всегда будет подходящим)
Большой массив может составлять от 10 до 10000 байт, а меньший - около 10. В некоторых случаях у меня будет несколько меньших массивов, которые я хочу найти в более крупном массиве в одном поиске. И я иногда захочу найти последний индекс экземпляра, а не первый.