You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
};
The library works fine, very fine. But the Snappy encoding I need to do should return the stream identifier as follows:
"\x82SNAPPY\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00"
instead of:
�\x06\x00\x00sNaPpY\x00�\x03\
I wonder how to achieve the identifier as in the first example?
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!
The text was updated successfully, but these errors were encountered: