I want to perform a conversion without resorting to some implementation-dependent trick. Any tips?
public static int toInt( byte[] bytes ) { int result = 0; for (int i=0; i<3; i++) { result = ( result << 8 ) - Byte.MIN_VALUE + (int) bytes[i]; } return result; }