AppendBytes encodes and adds an array of bytes to the dst byte array.
(dst, s []byte)
| 59 | |
| 60 | // AppendBytes encodes and adds an array of bytes to the dst byte array. |
| 61 | func (Encoder) AppendBytes(dst, s []byte) []byte { |
| 62 | major := majorTypeByteString |
| 63 | |
| 64 | l := len(s) |
| 65 | if l <= additionalMax { |
| 66 | lb := byte(l) |
| 67 | dst = append(dst, major|lb) |
| 68 | } else { |
| 69 | dst = appendCborTypePrefix(dst, major, uint64(l)) |
| 70 | } |
| 71 | return append(dst, s...) |
| 72 | } |
| 73 | |
| 74 | // AppendEmbeddedJSON adds a tag and embeds input JSON as such. |
| 75 | func AppendEmbeddedJSON(dst, s []byte) []byte { |
no test coverage detected