ReadInt16 reads an int16 and sets error on bounds violation
(err *Error)
| 335 | |
| 336 | // ReadInt16 reads an int16 and sets error on bounds violation |
| 337 | func (b *ByteBuffer) ReadInt16(err *Error) int16 { |
| 338 | if b.readerIndex+2 > len(b.data) { |
| 339 | if !b.fill(2, err) { |
| 340 | return 0 |
| 341 | } |
| 342 | } |
| 343 | v := int16(binary.LittleEndian.Uint16(b.data[b.readerIndex:])) |
| 344 | b.readerIndex += 2 |
| 345 | return v |
| 346 | } |
| 347 | |
| 348 | // ReadUint16 reads a uint16 and sets error on bounds violation |
| 349 | func (b *ByteBuffer) ReadUint16(err *Error) uint16 { |
no test coverage detected