byte[] buf = new byte[(int)raf.length()];只是规定了buf 数组的长度,为什么内容也直接进去了?并没有给里面的数组元素赋值啊
内容在raf中,raf.read(buf)就是说从raf读取内容,放进buf中去,所以buf是由内容的,求采纳
reads up to b.length bytes of data from this file into an array of bytes. This method blocks until at least one byte of input is available.这是read(byte[]b)的用法
难道和raf.read(buf)有关系吗?