0
Public static void main(String[] args) {
File inFile = null;
if (0 < args.length) {
inFile = new File(args[0]);
}
BufferedInputStream bStream = null;
try {
int read;
bStream = new BufferedInputStream(new FileInputStream(inFile));
while ((read = bStream.read()) > 0) {
getMarker(read, bStream);
System.out.println(read);
}
}
catch (IOException e) {
e.printStackTrace();
}
finally {
try {
if (bStream != null)bStream.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
private static void getMarker(int read, BufferedInputStream bStream) {
}
我想在bufferedInputStream中找到長1234567890。我能夠搜索bufferedInputStream一個長類型? (我不確定是否需要'閱讀'作爲參數,我懷疑它,我可以刪除它)。如何搜索bufferedInputStream?Java,在二進制文件輸入中搜索一長
「長」字大小爲8個字節。你的文件是8字節對齊的嗎? – fge
更重要的是,根據你的文件中的長文件是寫成小端還是大端,它的二進制表示有所不同。那麼,什麼是什麼? – fge