Java ByteBuffer from String toByteBuffer(String value)

Here you can find the source of toByteBuffer(String value)

Description

to Byte Buffer

License

Apache License

Declaration

public static ByteBuffer toByteBuffer(String value) throws UnsupportedEncodingException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;

public class Main {
    public static ByteBuffer toByteBuffer(String value) throws UnsupportedEncodingException {
        return ByteBuffer.wrap(value.getBytes("utf-8"));
    }/*from   w w w .  jav a2s . co  m*/
}

Related

  1. stringToNullTerminatedByteBuffer(String s)
  2. toByteBuffer(final String s)
  3. toByteBuffer(String hexStr)
  4. toByteBuffer(String s)
  5. toByteBuffer(String value)
  6. toByteBuffer(String value, String charsetName)