Here you can find the source of getBytes(String str)
private static byte[] getBytes(String str)
//package com.java2s; //License from project: Open Source License import java.util.*; import java.io.*; public class Main { private static byte[] getBytes(String str) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); StringTokenizer st = new StringTokenizer(str, "-", false); while (st.hasMoreTokens()) { int i = Integer.parseInt(st.nextToken()); bos.write((byte) i); }// www . ja v a 2 s. c om return bos.toByteArray(); } }