Java Byte Array Decode decode(byte[] src, String charset)

Here you can find the source of decode(byte[] src, String charset)

Description

decode

License

Open Source License

Declaration

public static String decode(byte[] src, String charset) 

Method Source Code


//package com.java2s;

import java.io.UnsupportedEncodingException;

public class Main {
    public static String decode(byte[] src, String charset) {
        return decode(src, 0, src.length, charset);
    }//from  w w  w .jav  a  2 s  .c  o  m

    public static String decode(byte[] src, int offset, int length, String charset) {
        try {
            return new String(src, offset, length, charset);
        } catch (UnsupportedEncodingException e) {
            return new String(src, offset, length);
        }
    }
}

Related

  1. decode(byte[] bytes)
  2. decode(byte[] bytes)
  3. decode(byte[] msgToDecode)
  4. decode(byte[] source)
  5. decode(byte[] source, int off, int len)
  6. decode(Byte[] wrap)
  7. decode(final byte[] source, final int off, final int len)
  8. decode(String encoding, byte[] bytes)
  9. decode(String encoding, byte[] data)