1. 程式人生 > >java網路流操作

java網路流操作

ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
byte[] buf = new byte[100];
int len = 0;
while ((len = inStream.read(buff, 0, 100)) > 0)
{
swapStream.write(buff, 0, len);
}
byte[] in_b = swapStream.toByteArray();
   2.