(data []byte, len int)
| 140 | } |
| 141 | |
| 142 | func (q *BytesQueue) push(data []byte, len int) { |
| 143 | headerEntrySize := binary.PutUvarint(q.headerBuffer, uint64(len)) |
| 144 | q.copy(q.headerBuffer, headerEntrySize) |
| 145 | |
| 146 | q.copy(data, len-headerEntrySize) |
| 147 | |
| 148 | if q.tail > q.head { |
| 149 | q.rightMargin = q.tail |
| 150 | } |
| 151 | if q.tail == q.head { |
| 152 | q.full = true |
| 153 | } |
| 154 | |
| 155 | q.count++ |
| 156 | } |
| 157 | |
| 158 | func (q *BytesQueue) copy(data []byte, len int) { |
| 159 | q.tail += copy(q.array[q.tail:], data[:len]) |
no test coverage detected