MCPcopy
hub / github.com/klauspost/compress / encodeRawTo

Method encodeRawTo

zstd/blockenc.go:323–334  ·  view source on GitHub ↗

encodeRaw can be used to set the output to a raw representation of supplied bytes.

(dst, src []byte)

Source from the content-addressed store, hash-verified

321
322// encodeRaw can be used to set the output to a raw representation of supplied bytes.
323func (b *blockEnc) encodeRawTo(dst, src []byte) []byte {
324 var bh blockHeader
325 bh.setLast(b.last)
326 bh.setSize(uint32(len(src)))
327 bh.setType(blockTypeRaw)
328 dst = bh.appendTo(dst)
329 dst = append(dst, src...)
330 if debugEncoder {
331 println("Adding RAW block, length", len(src), "last:", b.last)
332 }
333 return dst
334}
335
336// encodeLits can be used if the block is only litLen.
337func (b *blockEnc) encodeLits(lits []byte, raw bool) error {

Callers 1

encodeMethod · 0.95

Calls 5

setLastMethod · 0.95
setSizeMethod · 0.95
setTypeMethod · 0.95
appendToMethod · 0.95
printlnFunction · 0.85

Tested by

no test coverage detected