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) {
}
long 1234567890을 bufferedInputStream에서 찾고 싶습니다. bufferedInputStream을 긴 유형으로 검색 할 수 있습니까? (필자는 매개 변수로 '읽기'가 필요한지 잘 모르겠다. 의심 스럽지만 제거 할 수있다.) bufferedInputStream은 어떻게 검색합니까?자바, 이진 파일 입력에서 오랫동안 검색
'long'은 크기가 8 바이트입니다. 파일이 8 바이트로 정렬되어 있습니까? – fge
파일에서 long이 리틀 엔디안 또는 빅 엔디안으로 작성되었는지 여부에 따라 이진 표현이 다릅니다. 그래서, 무엇이 무엇입니까? – fge