WriteVarstrList writes a varint31 length prefix followed by the elements of l as varstrs.
(w io.Writer, l [][]byte)
| 170 | // WriteVarstrList writes a varint31 length prefix followed by the |
| 171 | // elements of l as varstrs. |
| 172 | func WriteVarstrList(w io.Writer, l [][]byte) (int, error) { |
| 173 | n, err := WriteVarint31(w, uint64(len(l))) |
| 174 | if err != nil { |
| 175 | return n, err |
| 176 | } |
| 177 | for _, s := range l { |
| 178 | n2, err := WriteVarstr31(w, s) |
| 179 | n += n2 |
| 180 | if err != nil { |
| 181 | return n, err |
| 182 | } |
| 183 | } |
| 184 | return n, err |
| 185 | } |
| 186 | |
| 187 | // WriteExtensibleString sends the output of the given function, plus |
| 188 | // the given suffix, to w, together with a varint31 length prefix. |