Describe the bug
When opening an old rar v2 file as a stream, an exception occurs when parsing headers, since the file does not have an EndArcHeader and the stream length is defined as Long.MAX_VALUE.
To Reproduce
try (InputStream is = getClass().getResourceAsStream("audio/BoatModernEnglish-audio-text-unpack20.rar")) {
try (Archive archive = new Archive(is)) {
...
Expected behavior
No Exception
File
src/test/resources/com/github/junrar/audio/BoatModernEnglish-audio-text-unpack20.rar
Environment (please complete the following information):
- OS: [Linux]
- Junrar version: [7.5.5]
Additional context
May be change InputStreamVolume/getLength to
public long getLength() {
try {
return inputStream.available();
} catch (IOException e) {
return Long.MAX_VALUE;
}
}
?
Describe the bug
When opening an old rar v2 file as a stream, an exception occurs when parsing headers, since the file does not have an EndArcHeader and the stream length is defined as Long.MAX_VALUE.
To Reproduce
Expected behavior
No Exception
File
src/test/resources/com/github/junrar/audio/BoatModernEnglish-audio-text-unpack20.rar
Environment (please complete the following information):
Additional context
May be change InputStreamVolume/getLength to
?