Implement NIO channels interfaces and add utility bulk transfer methods
bokken opened this issue · comments
Change AbstractSnappyInputStream to also implement ReadableByteChannel and have utility transfer methods that will write the entire (uncompressed) content to a given OutputStream or WritableByteChannel.
Change AbstractSnappyOutputStream to also implement WritableByteChannel and have utility transfer methods that will read from an InputStream or ReadableByteChannel and compress to the target.
While it is possible to accomplish this using Channels and utilities such as guava ByteStreams, doing it here eliminates some of the buffer copying required.
@bokken we have moved all development to https://github.com/airlift/aircompressor, which supports Snappy, LZ4 and LZO and includes Hadoop codec implementations for all of these. Unfortunately, I clearly don't have the time to work on this fork anymore. If you find issues with those implementations, please file an issue over there.