Comment lire un entier à partir d'un byte[]

J'ai un tableau d'octets, et je voudrais lire un entier à partir de ce tableau. Comment puis-je le faire?

Quelque chose comme ceci:

 int i;

 tab = new byte[32];

 i = readint(tab,0,3); //i = int from tab[0] to tab[3] (int = 4 bytes?)

 i = readint(tab,4,7);

etc...

OriginalL'auteur Rodger | 2011-06-16