Created
April 24, 2012 17:20
-
-
Save chrishuan9/2481669 to your computer and use it in GitHub Desktop.
Oneline Hex 2 Byte Converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.xml.bind.DatatypeConverter; | |
public static String toHexString(byte[] array) { | |
return DatatypeConverter.printHexBinary(array); | |
} | |
public static byte[] toByteArray(String s) { | |
return DatatypeConverter.parseHexBinary(s); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment