void RoundTrip(byte[] source) { var compressed = new byte[(long)source.Length * 6 / 5 + 32]; var compressedLength = SnappyCompress.Compress(compressed, source); var decompressed = SnappyDecompress.Decompress(ByteBuffer.NewSync(compressed, 0, compressedLength)); Assert.Equal(source, decompressed.ToArraySegment()); compressed = new byte[compressedLength / 2]; Assert.Equal(-1, SnappyCompress.Compress(compressed, source)); }
public void Basic() { var s = new byte[] { 1, 2, 3, 1, 2, 3, 1, 2, 3 }; var t = new byte[10]; var r = SnappyCompress.Compress(t, s); Assert.Equal(7, r); var d = SnappyDecompress.Decompress(ByteBuffer.NewSync(t, 0, r)); Assert.Equal(s, d.ToArraySegment()); }
public void Decompress(ref ByteBuffer data) { data = SnappyDecompress.Decompress(data); }
public void Decompress(ref ReadOnlySpan <byte> data) { data = SnappyDecompress.Decompress(data); }
public byte[] DecompressValue(ReadOnlySpan <byte> data) { return(SnappyDecompress.Decompress(data)); }