Java ByteBuffer from String stringToByteBuffer(String data)

Here you can find the source of stringToByteBuffer(String data)

Description

string To Byte Buffer

License

Apache License

Declaration

public static ByteBuffer stringToByteBuffer(String data) 

Method Source Code


//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*/
}

Related

  1. asByteBuffer(String data)
  2. asByteBuffer(String s)
  3. stringToByteBuffer(String string)
  4. stringToNullTerminatedByteBuffer(String s)
  5. toByteBuffer(final String s)
  6. toByteBuffer(String hexStr)