peekCheckErr is identical to peek, but does not actually return any data
(index int)
| 216 | |
| 217 | // peekCheckErr is identical to peek, but does not actually return any data |
| 218 | func (q *BytesQueue) peekCheckErr(index int) error { |
| 219 | |
| 220 | if q.count == 0 { |
| 221 | return errEmptyQueue |
| 222 | } |
| 223 | |
| 224 | if index <= 0 { |
| 225 | return errInvalidIndex |
| 226 | } |
| 227 | |
| 228 | if index >= len(q.array) { |
| 229 | return errIndexOutOfBounds |
| 230 | } |
| 231 | return nil |
| 232 | } |
| 233 | |
| 234 | // peek returns the data from index and the number of bytes to encode the length of the data in uvarint format |
| 235 | func (q *BytesQueue) peek(index int) ([]byte, int, error) { |