Here you can find the source of toByteArray(String hexDumpString)
Parameter | Description |
---|---|
hexDumpString | a parameter |
static public byte[] toByteArray(String hexDumpString)
//package com.java2s; /**/* w w w . j a v a 2s. c om*/ * Copyright (c) 2010-2015, openHAB.org and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ import javax.xml.bind.DatatypeConverter; public class Main { /** * Converts a hex string to byte array * @param hexDumpString * @return */ static public byte[] toByteArray(String hexDumpString) { return DatatypeConverter.parseHexBinary(hexDumpString.replaceAll( " ", "")); } }