Menu

#28 Problem with .arj format

9.20-2.00beta
open
nobody
None
5
2018-08-08
2018-08-08
Ivan
No

I have an .arj archive which contains 4 dbf files. Everything works OK when I opening it from filesystem using RandomAccessFileInStream. But now i have to open archive in memory, so I tried to use
ByteArrayStream, but it fails everytime with HRESULT: 0x1 (FALSE). Archive file (format: Arj) can't be opened, when calls native method
private static native IInArchive nativeOpenArchive(ArchiveFormat var0, IInStream var1, IArchiveOpenCallback var2) throws SevenZipException;

Some code

URL urlObj = new URL(url);
InputStream in = urlObj.openStream();
byte[] bytes = new byte[16041]; //16041 - exact size
int res = in.read(bytes);
in.close();
ByteArrayStream bas = new ByteArrayStream(bytes, false, 669781); //669781 - exact size of archive
IInArchive archive = SevenZip.openInArchive(ArchiveFormat.ARJ, bas); //problem here

Discussion


Log in to post a comment.