Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static byte[] convertStringToBytes(String str) {
        byte[] bytes = new byte[str.length() * Character.SIZE];
        System.arraycopy(str.toCharArray(), 0, bytes, 0, bytes.length);
        return bytes;
    }
}