0
인터넷에서 zip 파일을 다운로드하여 내부 저장소에 저장했습니다. zip 파일을 읽으려고하면 EOFException이 계속 나타납니다. 또한, 아래 스 니펫의 file.length()에서 얻은 길이가 실제 파일보다 큽니다.Android : zipfile 읽기 - EOFException
여기 내 코드 조각입니다. 당신은이 방법을 사용할 수 있습니다
File file = new File(filePath + "/" + zipFile);
long len = file.length();
FileInputStream fis = new FileInputStream(file);
BufferedInputStream bis = new BufferedInputStream(fis);
ZipInputStream zipInputStream = new ZipInputStream(bis);
나는이 시도했지만 한 나는 '파일 파일 = 새로운 파일 (적인 filePath + "/"+ zipFileName) 할 때' 'ZipFile를 ZipFile를을 = new ZipFile (파일); ' ArrayIndexOutOfBounds가 오류가 발생합니다. –
File file = new File (filePath + "/"+ "zipFileName.zip"); unzipFile (새 ZipFile (파일), 새 파일 (대상 경로)); – mustafasevgi