List of usage examples for java.lang Byte valueOf
public static Byte valueOf(String s, int radix) throws NumberFormatException
From source file:Main.java
public static void main(String[] args) { System.out.println("parse string to byte:" + Byte.valueOf("10", 8)); }
From source file:Main.java
public static byte[] addressToBytes(String address) { if (address == null || address.length() != STR_ADDRESS_LENGTH) { return null; }/*from w w w. j a va 2 s . co m*/ byte[] result = new byte[ADDRESS_LENGTH]; for (int i = 0; i < ADDRESS_LENGTH; ++i) { result[i] = Byte.valueOf(address.substring(3 * i, 3 * i + 2), 16); } return result; }