title: Find indexOf a byte array within another byte array
body: <p>Given a byte array, how can I find within it, the position of a (smaller) byte array?</p>
  
  <p><a href="http://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/ArrayUtils.html">This documentation</a> looked promising, using <code>ArrayUtils</code>, but if I'm correct it would only let me find an individual byte within the array to be searched.</p>
  
  <p>(I can't see it mattering, but just in case: sometimes the search byte array will be regular ASCII characters, other times it will be control characters or extended ASCII characters. So using String operations would not always be appropriate)</p>
  
  <p>The large array could be between 10 and about 10000 bytes, and the smaller array around 10. In some cases I will have several smaller arrays that I want found within the larger array in a single search. And I will at times want to find the last index of an instance rather than the first.</p>