Answers for "convert stringbuffer to string in java"

1

convert bytebuffer to string

String s = StandardCharsets.UTF_8.decode(byteBuffer).toString();
Posted by: Guest on March-31-2021
1

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);
Posted by: Guest on March-31-2021
0

convert stringbuffer to string in java

str.toString();
Posted by: Guest on August-31-2020

Code answers related to "convert stringbuffer to string in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language