try {
InputStream in=socket.getInputStream();
FileOutputStream file=new FileOutputStream( "/sdcard/123.jpeg");
byte byteBuffer[]=new byte[4096];
int amount;
while ((amount = in.read(byteBuffer)) != -1) {
file.write(byteBuffer, 0, amount); }
// 关闭流
in.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
说明
while ((amount = in.read(byteBuffer)) != -1)
这个循环没有执行
看看输出什么异常