[code="java"]while ((len = in.read(buf, 0, buf.length)) != -1) {
fos.write(buf, 0, len);[/code]
[code="java"]while ((len = in.read(buf)) != -1) {
fos.write(buf, 0, len);[/code]
这两个写法有多大区别
[code="java"]while ((len = in.read(buf, 0, buf.length)) != -1) {
fos.write(buf, 0, len);[/code]
[code="java"]while ((len = in.read(buf)) != -1) {
fos.write(buf, 0, len);[/code]
这两个写法有多大区别
是一样的, 参见 Sun JDK 文档:
http://java.sun.com/javase/6/docs/api/java/io/InputStream.html#read(byte[])