WriteInt16Slice writes []int16 to buffer using ARRAY protocol
(buf *ByteBuffer, value []int16)
| 775 | |
| 776 | // WriteInt16Slice writes []int16 to buffer using ARRAY protocol |
| 777 | func WriteInt16Slice(buf *ByteBuffer, value []int16) { |
| 778 | size := len(value) * 2 |
| 779 | buf.WriteLength(size) |
| 780 | if len(value) > 0 { |
| 781 | if isLittleEndian { |
| 782 | buf.WriteBinary(unsafe.Slice((*byte)(unsafe.Pointer(&value[0])), size)) |
| 783 | } else { |
| 784 | for i := 0; i < len(value); i++ { |
| 785 | buf.WriteInt16(value[i]) |
| 786 | } |
| 787 | } |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | // ReadInt16Slice reads []int16 from buffer using ARRAY protocol |
| 792 | func ReadInt16Slice(buf *ByteBuffer, err *Error) []int16 { |
no test coverage detected