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)
| 17 | // |
| 18 | // len(dst) >= MaxEncodedLen(len(src)) |
| 19 | func encodeBlock(dst, src []byte) (d int) { |
| 20 | if len(src) < minNonLiteralBlockSize { |
| 21 | return 0 |
| 22 | } |
| 23 | if len(src) <= 64<<10 { |
| 24 | return encodeBlockGo64K(dst, src) |
| 25 | } |
| 26 | return encodeBlockGo(dst, src) |
| 27 | } |
| 28 | |
| 29 | // encodeBlockBetter encodes a non-empty src to a guaranteed-large-enough dst. It |
| 30 | // assumes that the varint-encoded length of the decompressed bytes has already |
no test coverage detected
searching dependent graphs…