<@U3YFHFL1L> you're right. the wrap() isn't neede...
# tornadofx
c
@hudsonb you're right. the wrap() isn't needed. I updated my gist accordingly (and pulled it out of the client's code too)
a
You can do
ByteBuffer byteBuffer = ByteBuffer.wrap(a)
instead of
ByteBuffer byteBuffer = ByteBuffer.allocate(2); byteBuffer.put( a );
. In this case you skip one additional memory allocation, you just reuse memory under
a
. For large binaries additional allocation could be expensive.
c
thx
h
Ya, sorry that's what meant with my example as well, should have been more clear.