convert bytebuffer to string
String s = StandardCharsets.UTF_8.decode(byteBuffer).toString();
convert bytebuffer to string
String s = StandardCharsets.UTF_8.decode(byteBuffer).toString();
can't convert bytebuffer to string in java
// ...populate the buffer... buffer.flip(); // flip the buffer for reading byte[] bytes = new byte[buffer.remaining()]; // create a byte array the length of the number of bytes written to the buffer buffer.get(bytes); // read the bytes that were written String packet = new String(bytes);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us