Hello,
We use this small utility method. But we dont like it. Since it's not very crucial ( that work anyway ... ) , we have forget it. But that's ugly, because we have to go through the whole array, only to convert it from Byte[] to byte[]. I'm looking
- for a way to cast the Byte [] in byte [] without go throu it
- or for a utility method for cast a List into string
public static String byteListToString(List<Byte> l, Charset charset) {
if (l == null) {
return "" ;
}
byte[] array = new byte[l.size()];
int i = 0;
for (Byte current : l) {
array[i] = current;
i++;
}
return new String(array, charset);
}