}
private String toHex(byte[] byteArray) throws IOException {
InputStream in = new java.io.ByteArrayInputStream(byteArray);
StringWriter writer = new StringWriter();
WriterOutputStream wo = new WriterOutputStream(writer, "US-ASCII");
ASCIIHexOutputStream hex = new ASCIIHexOutputStream(wo);
IOUtils.copyLarge(in, hex);
return writer.toString();
}