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 !
走同樣的路,發(fā)現(xiàn)不同的人生
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.