Here you can find the source of toByteArrayNoConversion(String textz)
public static byte[] toByteArrayNoConversion(String textz)
//package com.java2s; /*/*w ww. j a v a 2s .com*/ SLEEP - Simple Language for Environment Extension Purposes .-------------------------------. | sleep.bridges.BridgeUtilities |____________________________________________ | | Author: Raphael Mudge (raffi@hick.org) http://www.hick.org/~raffi/ Description: utilities for bridge writers Documentation: Changelog: * This software is distributed under the artistic license, see license.txt for more information. * |____________________________________________________________________________| */ public class Main { /** converts the specified string to an array of bytes (useful as Sleep stores byte arrays to strings) */ public static byte[] toByteArrayNoConversion(String textz) { byte[] data = new byte[textz.length()]; for (int y = 0; y < data.length; y++) { data[y] = (byte) textz.charAt(y); } return data; } }