StefanoBelli commented on issue #4503: URL: https://github.com/apache/bookkeeper/issues/4503#issuecomment-2357974132
A workaround is setting the correct initial capacity for the destination ByteBuf (e.g. in testing class, the method overload allocBuf() should be modified to accept an integer and pass it as initial capacity for ByteBufAllocator.DEFAULT.buffer()). Having proper checks (even at the beginning of the BufferedChannel.read method) will of course fix this issue definitively, or you may specify this requirement in javadoc (to explicitly set the dest ByteBuf's *initial* capacity), or even let BufferedChannel's read to expand the destination ByteBuf object's capacity according to the "length" (e.g. if length > destBufLength then exceed capacity by length - destBufLength) actual value passed to BufferedChannel.read's parameter. -- 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]
