eerhardt commented on code in PR #13810:
URL: https://github.com/apache/arrow/pull/13810#discussion_r1167624136
##########
csharp/src/Apache.Arrow/ArrowBuffer.BitmapBuilder.cs:
##########
@@ -89,6 +89,37 @@ public BitmapBuilder Append(bool value)
return this;
}
+ /// <summary>
+ /// Append a span of bits.
+ /// </summary>
+ /// <param name="source">Source of bits to append.</param>
+ /// <param name="validBits">Number of valid bits in the source
span.</param>
+ /// <returns>Returns the builder (for fluent-style
composition).</returns>
+ public BitmapBuilder Append(ReadOnlySpan<byte> source, int
validBits)
+ {
+ if (!source.IsEmpty && validBits > source.Length * 8)
+ throw new ArgumentException($"Number of valid bits
({validBits}) cannot be greater than the the source span length ({source.Length
* 8} bits).", nameof(validBits));
Review Comment:
We should have a unit test for this.
##########
csharp/src/Apache.Arrow/ArrowBuffer.BitmapBuilder.cs:
##########
@@ -17,6 +17,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using Apache.Arrow.Memory;
+using FlatBuffers;
Review Comment:
```suggestion
```
##########
csharp/src/Apache.Arrow/ArrowBuffer.BitmapBuilder.cs:
##########
@@ -69,7 +70,6 @@ public BitmapBuilder(int capacity = DefaultBitCapacity)
Memory = new byte[BitUtility.ByteCount(capacity)];
Capacity = capacity;
}
-
/// <summary>
Review Comment:
```suggestion
/// <summary>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]