int arrayLength = input.available();
byte[] bytes = new byte[arrayLength];
int pos = 0;
while (true){
int n = input.read(bytes, pos, arrayLength-pos);
if(n <= 0)
break;
pos += n;
//System.out.println("pos=="+pos +"==="+n+"==="+input.available());
}
byte[] bytes = new byte[arrayLength];
int pos = 0;
while (true){
int n = input.read(bytes, pos, arrayLength-pos);
if(n <= 0)
break;
pos += n;
//System.out.println("pos=="+pos +"==="+n+"==="+input.available());
}
l为文件长度
打印byte[] 和l 看看 !!
byte [] buffer = new buffer[1024];
for(;;){
int len = readNextBuffer(buffer);
out.write(buf, 0,len);
}