private byte[] createHaystack(byte[] needle,int position,int size){
  byte[] haystack=new byte[size];
  for (int i=position, j=0; i < size && j < needle.length; i++, j++) {
    haystack[i]=needle[j];
  }
  return haystack;
}

private byte [ ] createHaystack ( byte [ ] needle , int position , int size ) { byte [ ] haystack = new byte [ size ] ; for ( int i = position , j = 0 ; i < size && j < needle . length ; i ++ , j ++ ) { haystack [ i ] = needle [ j ] ; } return haystack ; }
creates a haystack byte array of the give size with a needle that starts at the given position .
