cleishm commented on issue #88: URL: https://github.com/apache/incubator-tuweni/issues/88#issuecomment-657687195
What you're dealing with here is the semantics of Netty's `ByteBuf`. It contains pointers for readable and writable pointers and provides a method `Unpooled.buffer()` that provides a buffer who's capacity may vary between implementations, and it doesn't guarantee bytes are zeroed out. These are not features of the `Bytes` implementation in Tuweni. Given Netty provides methods to present just the "readable" bytes as a `ByteBuf`, e.g. `Unpooled.wrappedBuffer(byteBuf)`, I'm not sure the implementation of `Bytes.wrapByteBuffer(...)` is definitively wrong or needs to be changed, as you have the option to achieve what you're looking for via `Bytes.wrapByteBuffer(Unpooled.wrappedBuffer(...))`. That said, I'm sure @atoulme would also happily consider an alternative constructor method that inlines this behavior. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tuweni.apache.org For additional commands, e-mail: dev-h...@tuweni.apache.org