Java tutorial
//package com.java2s; public class Main { public static byte[] convertStringToByte(String str) { if (str == null) return null; return str.getBytes(); } }