(index int, encoded, value uint64)
| 1429 | } |
| 1430 | |
| 1431 | func (b *ByteBuffer) continuePutVarint36(index int, encoded, value uint64) int { |
| 1432 | // bits 14 |
| 1433 | encoded |= ((value & 0x1fc000) << 2) | 0x8000 |
| 1434 | if value>>21 == 0 { |
| 1435 | b.unsafePutInt32(index, int32(encoded)) |
| 1436 | return 3 |
| 1437 | } |
| 1438 | // bits 21 |
| 1439 | encoded |= ((value & 0xfe00000) << 3) | 0x800000 |
| 1440 | if value>>28 == 0 { |
| 1441 | b.unsafePutInt32(index, int32(encoded)) |
| 1442 | return 4 |
| 1443 | } |
| 1444 | // bits 28 |
| 1445 | encoded |= ((value & 0xff0000000) << 4) | 0x80000000 |
| 1446 | b.unsafePutInt64(index, encoded) |
| 1447 | return 5 |
| 1448 | } |
| 1449 | |
| 1450 | func (b *ByteBuffer) unsafePutInt32(index int, v int32) { |
| 1451 | binary.LittleEndian.PutUint32(b.data[index:], uint32(v)) |
no test coverage detected