Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static int[] byte2int(byte[] src, int height, int width) { int dstLength = src.length; int[] dst = new int[dstLength]; for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { Byte b = new Byte(src[height * (143 - j) + i]); dst[(width * i) + j] = b.intValue() & 0x000000ff; if (dst[(width * i) + j] < 0) { System.out.println(dst[(width * i) + j]); } } } return dst; } }