Here you can find the source of stringToByteBuffer(String data)
public static ByteBuffer stringToByteBuffer(String data)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { public static ByteBuffer stringToByteBuffer(String data) { return ByteBuffer.wrap(data.getBytes()); }/*w ww. j a va2s .c o m*/ }