All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mogudiandian.util.compressor.SnappyCompressor Maven / Gradle / Ivy

There is a newer version: 1.0.19
Show newest version
package com.mogudiandian.util.compressor;

import lombok.SneakyThrows;
import org.xerial.snappy.Snappy;

/**
 * google snappy压缩器
 * (C++) https://github.com/google/snappy/
 * (Java-JNI) https://github.com/xerial/snappy-java
 * (Java-Port) https://github.com/dain/snappy
 * @author Joshua Sun
 * @since 1.0.0
 */
public final class SnappyCompressor implements Compressor {

    @SneakyThrows
    public byte[] compress(byte[] bytes) {
        return Snappy.compress(bytes);
    }

    @SneakyThrows
    public byte[] decompress(byte[] bytes) {
        return Snappy.uncompress(bytes);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy