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