Change line
keyArray[row][col] = Byte.valueOf(result, 16);
to
keyArray[row][col] = (byte) Integer.valueOf(result, 16).intValue();
edit
or even shorter, as correctly stated in Bohemian's answer :
keyArray[row][col] = (byte) Integer.parseInt(result, 16);