encodeRaw can be used to set the output to a raw representation of supplied bytes.
(dst, src []byte)
| 321 | |
| 322 | // encodeRaw can be used to set the output to a raw representation of supplied bytes. |
| 323 | func (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. |
| 337 | func (b *blockEnc) encodeLits(lits []byte, raw bool) error { |