(w jsWriter, msg []byte, scratch []byte, depth int)
| 184 | } |
| 185 | |
| 186 | func rwBytesBytes(w jsWriter, msg []byte, scratch []byte, depth int) ([]byte, []byte, error) { |
| 187 | bts, msg, err := ReadBytesZC(msg) |
| 188 | if err != nil { |
| 189 | return msg, scratch, err |
| 190 | } |
| 191 | l := base64.StdEncoding.EncodedLen(len(bts)) |
| 192 | if cap(scratch) >= l { |
| 193 | scratch = scratch[0:l] |
| 194 | } else { |
| 195 | scratch = make([]byte, l) |
| 196 | } |
| 197 | base64.StdEncoding.Encode(scratch, bts) |
| 198 | err = w.WriteByte('"') |
| 199 | if err != nil { |
| 200 | return msg, scratch, err |
| 201 | } |
| 202 | _, err = w.Write(scratch) |
| 203 | if err != nil { |
| 204 | return msg, scratch, err |
| 205 | } |
| 206 | err = w.WriteByte('"') |
| 207 | return msg, scratch, err |
| 208 | } |
| 209 | |
| 210 | func rwNullBytes(w jsWriter, msg []byte, scratch []byte, depth int) ([]byte, []byte, error) { |
| 211 | msg, err := ReadNilBytes(msg) |
no test coverage detected
searching dependent graphs…