We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bijection that moves between deflated and inflated bytes.
Here's the idea (please forgive my lack of wrapper classes):
import java.util.zip.{ Deflater, Inflater, InflaterInputStream, DeflaterOutputStream } import java.io.{ ByteArrayInputStream, ByteArrayOutputStream } class DeflaterBijection(deflater: Deflater, inflater: Inflater) extends AbstractBijection[Array[Byte], Array[Byte]] { def apply(bytes: Array[Byte]) = { val baos = new ByteArrayOutputStream val dos = new DeflaterOutputStream(baos, deflater) dos.write(bytes) dos.close baos.toByteArray } override def invert(bytes: Array[Byte]) = { val baos = new ByteArrayOutputStream StreamUtils.copy(new InflaterInputStream(new ByteArrayInputStream(bytes), inflater), baos) baos.toByteArray } }
The text was updated successfully, but these errors were encountered:
Looks fine, but I think we should wrap this:
https://github.com/dain/snappy/tree/master/src/main/java/org/iq80/snappy
Much better performance (much faster), pure Java, Apache license. We should encourage using snappy when we want performance.
Sorry, something went wrong.
No branches or pull requests
Bijection that moves between deflated and inflated bytes.
Here's the idea (please forgive my lack of wrapper classes):
The text was updated successfully, but these errors were encountered: