Here you can find the source of toAsciiBytes(final String value)
Parameter | Description |
---|---|
value | to convert to byte array |
public static final byte[] toAsciiBytes(final String value)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from www . j a v a 2 s . co m*/ * Convert specified String to a byte array. * * @param value to convert to byte array * @return the byte array value */ public static final byte[] toAsciiBytes(final String value) { byte[] result = new byte[value.length()]; for (int i = 0; i < value.length(); i++) { result[i] = (byte) value.charAt(i); } return result; } }