static int[] byteHistogramArray(byte[] data) { var histogram = new int[256]; if (data != null) for (b : data) histogram[b & 0xFF]++; ret histogram; }