java - Related questions about ByteBuffer
怪我咯
怪我咯 2017-05-16 13:29:23
0
2
607

How to convert a string into ByteBuffer in Java and store it in ByteBuffer in binary form, because it needs to be sent to C++
Please give me a detailed Java method, I don’t know much about ByteBuffer, thank you !

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
滿天的星座

You can first convert the string into a byte array byte[], and then use the put method of ByteBuffer to write it into the buffer.

仅有的幸福
ByteBuffer.wrap(yourString.getBytes(Charset));
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template