(buf *ByteBuffer, err *Error, length int, hasNull bool, typeID TypeId)
| 818 | } |
| 819 | |
| 820 | func readIntListValues(buf *ByteBuffer, err *Error, length int, hasNull bool, typeID TypeId) []int { |
| 821 | result := make([]int, length) |
| 822 | if reflect.TypeOf(int(0)).Size() == 8 { |
| 823 | values := readInt64ListValues(buf, err, length, hasNull, typeID) |
| 824 | copy(unsafe.Slice((*int64)(unsafe.Pointer(&result[0])), length), values) |
| 825 | return result |
| 826 | } |
| 827 | for i := 0; i < length; i++ { |
| 828 | if hasNull && buf.ReadInt8(err) == NullFlag { |
| 829 | continue |
| 830 | } |
| 831 | if typeID == INT32 { |
| 832 | result[i] = int(buf.ReadInt32(err)) |
| 833 | } else { |
| 834 | result[i] = int(buf.ReadVarint32(err)) |
| 835 | } |
| 836 | } |
| 837 | return result |
| 838 | } |
| 839 | |
| 840 | func writeUintListValues(buf *ByteBuffer, value []uint, typeID TypeId) { |
| 841 | if reflect.TypeOf(uint(0)).Size() == 8 { |
no test coverage detected