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 try to use snappy with golang, I see JS and Java has a function named isValidCompressed which can validate the encoded buffer, but I can't see that function with golang.
I am thinking to use decode function directly. And if it returns error, it means the encoded buffer is invalid. But I am not sure that's safe/correct or not.
Such as below: byte[] bytes = Snappy.isValidCompressedBuffer(recordBytes) ? Snappy.uncompress(recordBytes) : recordBytes;
Anyone have any ideas on how to safe and quickly validate the encoded buffer?
The text was updated successfully, but these errors were encountered:
Hey,
I try to use snappy with golang, I see JS and Java has a function named
isValidCompressed
which can validate the encoded buffer, but I can't see that function with golang.I am thinking to use decode function directly. And if it returns error, it means the encoded buffer is invalid. But I am not sure that's safe/correct or not.
Such as below:
byte[] bytes = Snappy.isValidCompressedBuffer(recordBytes) ? Snappy.uncompress(recordBytes) : recordBytes;
Anyone have any ideas on how to safe and quickly validate the encoded buffer?
The text was updated successfully, but these errors were encountered: