I'd like to extract a zip/jar entry into memory so I can close the zip stream/FS and keep the file in the JVM without dealing with temporary copies.
One option is to use Files.readAllLines(Path pathToZipFSentry), but it seems it used a buffered reader which can penalize a lot for big files.
So I am researching how to do it in Java NIO2 and it seems the way is ending with a MappedByteBuffer through FileChannels.
I cannot use the RandomAccessFile.getChannel() as I come from a Path of a virtual FileSystem, not a literal File. I cannot use Files.newByteChannel(rscPath, StandardOpenOption.READ) and then (fileChannel.)map() because it returns a SeekableByteChannel which doesn't got map in the interface...
Is thee any one/two high level liners for this by means of Path(s)/File(s)/FileSystem(s)/FileChannel(s) in Java8? I would expect something like InMemoryFile file = Files.loadIntoMem(Path) I've been 1 hour looking for a close option...