java writeint() ?
writeint()把288 转为什么byte[]?
[解决办法]
楼主把问题描述清楚一点?
[解决办法]
public static byte[] intArrayToByteArray(int[] array) {
byte[] b = new byte[array.length * 4];
for (int i = 0; i < array.length; i++) {
ByteArrayOutputStream boutput = new ByteArrayOutputStream();
DataOutputStream doutput = new DataOutputStream(boutput);
try {
doutput.writeInt(array[i]);
} catch (IOException e) {
e.printStackTrace();
}
byte[] temp = boutput.toByteArray();
for (int j = 0; j < temp.length; j++) {
b[i * 4 + j] = temp[j];
}
}
return b;
}