Description
I need to save a JSON object to a Redis Database.
I am able to save, but I can't decrypt back from Redis.
It seems like I need to add a Stream Identifier to the compressed string to indicate it's a Snappy type.
`
/**
* All streams should start with the "Stream identifier", containing chunk
* type 0xff, a length field of 0x6, and 'sNaPpY' in ASCII.
*/
private static final byte[] STREAM_START = {
(byte) 0xff, 0x06, 0x00, 0x00, 0x73, 0x4e, 0x61, 0x50, 0x70, 0x59
};
`
This is the class the guys in Java are using..
https://programtalk.com/vs/?source=netty/codec/src/main/java/io/netty/handler/codec/compression/SnappyFrameEncoder.java
My question is, how can I generate a stream with those characteristics?
The rest of the payload it's a json object.
I.e.
const jsonObjectBody = '{ "myObjKey": "myObjValue" }';
const jsonObjectBodyStreamWithStreamIdentifier = ?????
Thank you very much!