ReadUint8 reads a uint8 and sets error on bounds violation
(err *Error)
| 1259 | |
| 1260 | // ReadUint8 reads a uint8 and sets error on bounds violation |
| 1261 | func (b *ByteBuffer) ReadUint8(err *Error) uint8 { |
| 1262 | if b.readerIndex >= len(b.data) { |
| 1263 | if !b.fill(1, err) { |
| 1264 | return 0 |
| 1265 | } |
| 1266 | } |
| 1267 | v := b.data[b.readerIndex] |
| 1268 | b.readerIndex++ |
| 1269 | return v |
| 1270 | } |
| 1271 | |
| 1272 | // WriteVarint32 writes a signed int32 using zigzag encoding (compatible with Java's writeVarint32). |
| 1273 | func (b *ByteBuffer) WriteVarint32(value int32) int8 { |