Here you can find the source of decodeBytes(byte[] data, String encoding)
public static String decodeBytes(byte[] data, String encoding)
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; public class Main { /**/*from www . j av a2 s. c om*/ * Returns the UTF-8 string corresponding to the specified bytes. */ public static String decodeBytes(byte[] data, String encoding) { try { return new String(data, encoding); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Error decoding bytes with " + encoding, e); } } }