(w io.Writer, val uint64)
| 137 | } |
| 138 | |
| 139 | func WriteVarint31(w io.Writer, val uint64) (int, error) { |
| 140 | if val > math.MaxInt32 { |
| 141 | return 0, ErrRange |
| 142 | } |
| 143 | buf := bufPool.Get().(*[9]byte) |
| 144 | n := binary.PutUvarint(buf[:], val) |
| 145 | b, err := w.Write(buf[:n]) |
| 146 | bufPool.Put(buf) |
| 147 | return b, err |
| 148 | } |
| 149 | |
| 150 | func WriteVarint63(w io.Writer, val uint64) (int, error) { |
| 151 | if val > math.MaxInt64 { |