Java UTF8 From getUtf8Bytes(String s)

Here you can find the source of getUtf8Bytes(String s)

Description

get Utf Bytes

License

Open Source License

Declaration

public static byte[] getUtf8Bytes(String s) 

Method Source Code


//package com.java2s;
import java.io.UnsupportedEncodingException;

public class Main {
    public static byte[] getUtf8Bytes(String s) {
        try {/*from w w  w.  j  a  v  a2s. c o  m*/
            return s.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException("UTF-8 not found.", e);
        }
    }
}

Related

  1. getUTF8(String data)
  2. getUTF8(String s)
  3. getUTF8(String string)
  4. getUTF8Bytes(String data)
  5. getUTF8Bytes(String s)
  6. getUTF8Bytes(String s)
  7. getUtf8Bytes(String s)
  8. getUTF8Bytes(String str)
  9. getUtf8Bytes(String str)