Java UTF8 fromUTF8(byte[] bytes)

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

Description

Decodes UTF-8 bytes to String.

License

Open Source License

Declaration

public static String fromUTF8(byte[] bytes) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.nio.charset.Charset;

public class Main {
    public static final Charset UTF_8 = Charset.forName("UTF-8");

    /**//from   w  w  w  .j a  v  a2 s . com
     * Decodes UTF-8 bytes to String.
     *
     * @see #fromUTF8(byte[], int, int)
     */
    public static String fromUTF8(byte[] bytes) {
        return fromUTF8(bytes, 0, bytes.length);
    }

    /**
     * Decodes UTF-8 bytes to String.
     */
    public static String fromUTF8(byte[] bytes, int off, int len) {
        return new String(bytes, off, len, UTF_8);
    }
}

Related

  1. decUTF8(String s)
  2. dumpStringArray(Path outputFilePath, String[] stringArray)
  3. dumpUtf8ToFile(List records, String delimiter, File file)
  4. fromUTF8(byte[] ba)
  5. fromUTF8(byte[] bytes)
  6. generateRawUTF8Bytes(final String string)
  7. getBytesUtf8(final String string)
  8. getFile(String outputFolder, String fileName)
  9. getFiles(String InputFilePath)