Java UTF8 Convert To getBytesUtf8(String string)

Here you can find the source of getBytesUtf8(String string)

Description

get Bytes Utf

License

Open Source License

Declaration

public static byte[] getBytesUtf8(String string) throws UnsupportedEncodingException 

Method Source Code

//package com.java2s;

import java.io.UnsupportedEncodingException;

public class Main {
    public static byte[] getBytesUtf8(String string) throws UnsupportedEncodingException {
        if (string == null) {
            return null;
        }/*w  w  w. j a  v  a2s  .c  om*/
        return string.getBytes("UTF-8");
    }
}

Related

  1. fromUTF8Bytes(byte[] bytes)
  2. getBytesUtf8(String str)
  3. getBytesUtf8(String string)
  4. getBytesUtf8(String string)
  5. getBytesUTF8(String string)
  6. UTF8ToCodePoint(byte[] b, int s)
  7. utf8ToCodePoint(int b1, int b2, int b3, int b4)
  8. utf8Togb2312(String str)
  9. utf8ToString(byte[] src, int stPos, int utf8Len)