"Transposition" string en byte[]
Bonjour,
Dans le cadre d'un test, j'ai un fichier texte rempli de la manière suivante : "1,35,0,2,0,85,2,158,0,0,0,33,230,15, ..."
Avec un split, je transforme cette chaine de caractères en un string[] :
Code:
1 2 3 4 5 6 7 8 9
|
string[0] = 1
string[1] = 35
string[2] = 0
string[3] = 2
string[4] = 0
string[5] = 85
string[6] = 2
string[7] = 158... |
Mais je souhaiterais obtenir un tableau de byte[] rempli de la manière suivante :
Code:
1 2 3 4 5 6 7 8 9
|
byte[0] = 1
byte[1] = 35
byte[2] = 0
byte[3] = 2
byte[4] = 0
byte[5] = 85
byte[6] = 2
byte[7] = 158... |
Comment faire ?