我有一个使用JAVA
编写的文件,其中包含一组用二进制编写的整数数组。我使用for循环遍历该数组,并使用此方法将其写入。
public static void writeInt(OutputStream out, int v) throws IOException {
out.write((v >>> 24) & 0xFF);
out.write((v >>> 16) & 0xFF);
out.write((v >>> 8) & 0xFF);
out.write((v >>> 0) & 0xFF);
}
我想问如何在PHP
中读取这个文件。
$filename = "myFile.sav"; $handle = fopen($filename, "rb"); $contents = fread($handle, filesize($filename));
- BlackRoot