final char [] CHARS = DATA;
final Map<Integer, IntHolder> counts = new HashMap<Integer, IntHolder>();
for (int i = 0; i < CHARS.length - 1; i++)
{
final int bigram = CHARS[i] << 16 | CHARS[i+1];
final IntHolder currentCount = counts.get(bigram);
if (currentCount == null)
{
counts.put(bigram, new IntHolder(1));
}
else
{
currentCount.value++;
}