Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.io.*;

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

    public static byte[] stringToByteArray(String s) {
        try {
            return s.getBytes(ENCODING);
        } catch (UnsupportedEncodingException ex) {
            return null;
        }
    }
}