luben / zstd-jni

JNI binding for Zstd
Other
809 stars 165 forks source link

Add skip() to ZstdBufferDecompressingStream #259

Open divijvaidya opened 1 year ago

divijvaidya commented 1 year ago

Users of ZstdBufferDecompressingStream may have a requirement to skip reading some uncompressed bytes. A similar method exists in ZstdInputStream.

The skip() method should:

  1. Use a BufferPool if provided.
  2. Allocate buffer only once from the BufferSupplier.
  3. Returns the number of bytes skipped.

The interface should be modeled similar to InputStream#skip(long n).

luben commented 9 months ago

Sounds reasonable, contributions welcome.