eerhardt commented on code in PR #35342:
URL: https://github.com/apache/arrow/pull/35342#discussion_r1187540072
##########
csharp/src/Apache.Arrow/BitUtility.cs:
##########
@@ -62,6 +62,64 @@ public static void SetBit(Span<byte> data, int index, bool
value)
: (byte)(data[idx] & ~BitMask[mod]);
}
+ /// <summary>
+ /// Set the number of bits in a span of bytes starting
+ /// at a specific index, and limiting to length.
+ /// </summary>
+ /// <param name="data">Span to set bits value.</param>
+ /// <param name="offset">Bit index to start counting from.</param>
+ /// <param name="length">Maximum of bits in the span to
consider.</param>
+ public static void SetBits(Span<byte> data, int index, int length,
bool value)
Review Comment:
Since this is a public API, can we do some argument checking? For example,
`index + length < data.Length` and both `index` and `length` are non-negative.
##########
csharp/src/Apache.Arrow/ArrowBuffer.BitmapBuilder.cs:
##########
@@ -138,6 +138,24 @@ public BitmapBuilder AppendRange(IEnumerable<bool> values)
return this;
}
+ /// <summary>
+ /// Append multiple bits.
+ /// </summary>
+ /// <param name="value">Value of bits to append.</param>
+ /// <param name="length">Number of times the value should be
added.</param>
+ /// <returns>Returns the builder (for fluent-style
composition).</returns>
+ public BitmapBuilder AppendRange(bool value, int length)
Review Comment:
Should check that `length` is non-negative.
--
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]