Now that we have a few uses of compression/decompression on ByteBuffers it is time to finalize the interface before it becomes set in stone with 2.2. The current code has some shortcomings:
- The interface uses the buffers' positions and limits instead of accepting offset and length as parameters. This necessitates that the buffers be duplicated before they can be compressed for thread-safety, something that adds burden to the caller, is prone to being forgotten, and we could generally do without for performance.
- The direct/non-direct buffer support needs to be more clearly defined. The current useDirectOutputByteBuffers is not named well.
- If we don't want to support non-direct buffers everywhere as a fallback, we should clearly state the decision and rationale.
- How should WrappedByteBuffer treat direct/indirect buffers?
- More testing is necessary as e.g. errors in DeflateCompressor were only caught in