[color=darkblue][i][b]1:byte[]转换为InputStream流[/b][/i][/color]
[color=darkblue][i][b]2:InputStream转换为byte[]数组[/b][/i][/color]
InputStream sbs = new ByteArrayInputStream(byte[] buf);
[color=darkblue][i][b]2:InputStream转换为byte[]数组[/b][/i][/color]
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
byte[] buff = new byte[100]; //buff用于存放循环读取的临时数据
int rc = 0;
while ((rc = inStream.read(buff, 0, 100)) > 0) {
swapStream.write(buff, 0, rc);
}
byte[] in2b = swapStream.toByteArray(); //in_b为转换之后的结果