encodeBlock encodes a non-empty src to a guaranteed-large-enough dst. It assumes that the varint-encoded length of the decompressed bytes has already been written. It also assumes that: len(dst) >= MaxEncodedLen(len(src))
(dst, src []byte)
| 62 | // |
| 63 | // len(dst) >= MaxEncodedLen(len(src)) |
| 64 | func encodeBlockSnappy(dst, src []byte) (d int) { |
| 65 | if len(src) < minNonLiteralBlockSize { |
| 66 | return 0 |
| 67 | } |
| 68 | if len(src) <= 64<<10 { |
| 69 | return encodeBlockSnappyGo64K(dst, src) |
| 70 | } |
| 71 | return encodeBlockSnappyGo(dst, src) |
| 72 | } |
| 73 | |
| 74 | // emitLiteral writes a literal chunk and returns the number of bytes written. |
| 75 | // |
no test coverage detected
searching dependent graphs…