// Fetch the last 5 bytes, try with a partial match at the end.
byte[] blobEnd = blob.getBytes(size - 4, 5);
pattern = new byte[6];
System.arraycopy(blobEnd, 0, pattern, 0, blobEnd.length);
pattern[5] = 'X'; // Only lowercase in the looping alphabet stream.
assertEquals(-1, blob.position(pattern, size - 10));
// Get the very last byte, try with a partial match at the end.
blobEnd = blob.getBytes(size, 1);
pattern = new byte[] {blobEnd[0], 'X'};
assertEquals(-1, blob.position(pattern, size - 5));