Here you can find the source of UTF8GetBytes(final String value)
Parameter | Description |
---|---|
value | The string containing the characters to encode. |
public static byte[] UTF8GetBytes(final String value)
//package com.java2s; // Licensed under the MIT license. See License.txt in the project root. import java.nio.charset.Charset; public class Main { private static final Charset UTF8 = Charset.forName("UTF-8"); /**/*from ww w.ja va2 s . c o m*/ * Encodes all the characters in the specified string into a sequence of UTF-8 bytes. * * @param value The string containing the characters to encode. * @return A byte array containing the results of encoding the specified set of characters. */ public static byte[] UTF8GetBytes(final String value) { final byte[] result = value.getBytes(UTF8); return result; } }