ReadByte reads a byte and sets error on bounds violation
(err *Error)
| 311 | |
| 312 | // ReadByte reads a byte and sets error on bounds violation |
| 313 | func (b *ByteBuffer) ReadByte(err *Error) byte { |
| 314 | if b.readerIndex+1 > len(b.data) { |
| 315 | if !b.fill(1, err) { |
| 316 | return 0 |
| 317 | } |
| 318 | } |
| 319 | v := b.data[b.readerIndex] |
| 320 | b.readerIndex++ |
| 321 | return v |
| 322 | } |
| 323 | |
| 324 | // ReadInt8 reads an int8 and sets error on bounds violation |
| 325 | func (b *ByteBuffer) ReadInt8(err *Error) int8 { |