Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// and/or modify it under the terms of the GNU General Public License 

import java.io.UnsupportedEncodingException;

public class Main {
    public static byte[] getBytes(final String value) {
        try {
            if (value == null) {
                return new byte[0];
            }
            return value.getBytes("ASCII");
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e.getMessage());
        }
    }
}