Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.UnsupportedEncodingException;

public class Main {

    public static final byte[] getGB2312ByteArray(String str) {
        byte[] tmp;
        try {
            tmp = str.getBytes("GB2312");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return null;
        }
        return tmp;

    }
}