code: public static String bytesToString(ByteBuffer b) {
      return Unpooled.wrappedBuffer(b).toString(StandardCharsets.UTF_8);
    }
docs: Convert the given byte buffer to a string. The resulting string can be
  converted back to the same byte buffer through {@link #stringToBytes(String)}.