mjsax commented on code in PR #21762:
URL: https://github.com/apache/kafka/pull/21762#discussion_r2937248161
##########
streams/src/main/java/org/apache/kafka/streams/state/internals/Utils.java:
##########
@@ -27,6 +27,23 @@
import java.nio.ByteBuffer;
public class Utils {
+ /**
+ * Create a new ByteBuffer to store {@code bufferSize} bytes, after a
var-length encoded prefix.
+ */
+ static ByteBuffer prepareByteBufferWithSizePrefix(final int prefix, final
int bufferSize) {
+ final ByteBuffer varLengthBuffer = ByteBuffer.allocate(5); // 5 bytes
for max varint encoding
+ ByteUtils.writeVarint(prefix, varLengthBuffer);
Review Comment:
Oh. I missed that we have `sizeOfVarint` -- I was actually considering to
maybe add such a helper -- this simplifies things quite a bit.
--
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]