Java Byte Array Encode encodeAsUtf8(byte[] bytes)

Here you can find the source of encodeAsUtf8(byte[] bytes)

Description

encode As Utf

License

Apache License

Declaration

public static String encodeAsUtf8(byte[] bytes) 

Method Source Code


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

import java.io.UnsupportedEncodingException;

public class Main {
    public static final String UTF_8 = "UTF-8";

    public static String encodeAsUtf8(byte[] bytes) {
        try {//from www .  j  av  a 2  s .c  om
            return new String(bytes, UTF_8);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. encode(byte[] input)
  2. encode(byte[] message)
  3. encode(byte[] rawData)
  4. encode(byte[] source)
  5. encode(String prefix, byte[] buf, ZipOutputStream zos, File[] files)
  6. encodeBitString(byte[] in, OutputStream os)
  7. encodeByteArray(DataOutputStream out, byte[] bytes)
  8. encodeBytes(byte[] source, int off, int len)
  9. encodeCompositeAlways(List bytesList)