Here you can find the source of bytesToGb2312(final byte[] bytes)
public static String bytesToGb2312(final byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { public static final String GB2312 = "GB2312"; public static String bytesToGb2312(final byte[] bytes) { return bytesToCharset(bytes, GB2312); }//from w w w .j a va 2 s . c om public static String bytesToCharset(final byte[] bytes, final String charset) { try { return new String(bytes, charset); } catch (Exception e) { e.printStackTrace(); } return null; } }