Java UTF8 Encode toUTF8String(byte[] b, int offset, int length)

Here you can find the source of toUTF8String(byte[] b, int offset, int length)

Description

to UTF String

License

Open Source License

Declaration

public static String toUTF8String(byte[] b, int offset, int length) 

Method Source Code


//package com.java2s;
//are made available under the terms of the Eclipse Public License v1.0

import java.io.UnsupportedEncodingException;

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

    public static String toUTF8String(byte[] b, int offset, int length) {
        try {// ww w .  j  av a 2 s  . c  om
            return new String(b, offset, length, __UTF8);
        } catch (UnsupportedEncodingException e) {
            throw new IllegalArgumentException(e);
        }
    }
}

Related

  1. toUTF8ByteArray(char[] string)
  2. toUTF8Bytes(final String s)
  3. toUTF8Bytes(String src)
  4. toUTF8Bytes(String string)
  5. toUTF8InputStream(String str)
  6. utf8Code(String str)
  7. Utf8codeCheck(String text)
  8. utf8Encode(final Collection col)
  9. utf8Encode(final String s)