public void Visit(FixedWidthType type) { CheckData(type, 2); ArrowBuffer validityBuffer = ConcatenateValidityBuffer(); ArrowBuffer valueBuffer = ConcatenateFixedWidthTypeValueBuffer(type); Result = new ArrayData(type, _totalLength, _totalNullCount, 0, new ArrowBuffer[] { validityBuffer, valueBuffer }); }
private ArrowBuffer ConcatenateFixedWidthTypeValueBuffer(FixedWidthType type) { int typeByteWidth = type.BitWidth / 8; var builder = new ArrowBuffer.Builder <byte>(_totalLength * typeByteWidth); foreach (ArrayData arrayData in _arrayDataList) { int length = arrayData.Length; int byteLength = length * typeByteWidth; builder.Append(arrayData.Buffers[1].Span.Slice(0, byteLength)); } return(builder.Build(_allocator)); }