Reading a GZIP file from a FileChannel (Java NIO)?

You could obtain a wrapping InputStream around the FileChannel.

You could obtain a wrapping InputStream around the FileChannel: FileChannel fc = ... GZIPInputStream gis = new GZIPInputStream(Channels. NewInputStream(fc)); Channels is in Java SE.

Yes, there is a solution. Implementing GZip is fairly simple. You need a Inflater and CRC32, plus reading the header/trailer.

Unfortunately java.util.zip. Inflater takes only byte which is suboptimal (a direct Buffer would have been times more efficient). Yet, using non-direct buffer and ByteBuffer.array() is an option.

The built in java.util.zip. CRC32 is quite slow and reimplementing it in java is a nice step towards performance. Com.jcraft.

Jzlib offers pure java implementation (almost looks like pure C, though) and it's possible to replace the byte w/ direct Buffer. The library is somewhat slower compared to inflater (decomppress) due to too many bounds check and inability to perform so deep inline. Yet, it's faster on compression.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions