use of org.iq80.snappy.SnappyInputStream in project NabAlive by jcheype.
the class DataUtil method decompress.
public static byte[] decompress(byte[] in) throws IOException {
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(in);
SnappyInputStream inputStream = new SnappyInputStream(byteArrayInputStream);
return ByteStreams.toByteArray(inputStream);
}
use of org.iq80.snappy.SnappyInputStream in project NabAlive by jcheype.
the class TokenUtil method decode.
public static <T> T decode(byte[] cryptedBytes, Class<T> clazz) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, DecoderException, IOException {
byte[] bytes = cipherDecrypt.get().doFinal(cryptedBytes);
SnappyInputStream snappyInputStream = new SnappyInputStream(new ByteArrayInputStream(bytes));
//MessagePack messagePack = new MessagePack();
return messagePack.read(ByteStreams.toByteArray(snappyInputStream), clazz);
}
use of org.iq80.snappy.SnappyInputStream in project NabAlive by jcheype.
the class DataUtil method decompress.
public static ChannelBuffer decompress(ChannelBuffer in) throws IOException {
ChannelBufferInputStream channelBufferInputStream = new ChannelBufferInputStream(in);
SnappyInputStream inputStream = new SnappyInputStream(channelBufferInputStream);
ChannelBuffer channelBuffer = ChannelBuffers.copiedBuffer(ByteStreams.toByteArray(inputStream));
return channelBuffer;
}
Aggregations