List of usage examples for java.nio ByteOrder toString
public String toString()
From source file:edu.harvard.iq.dvn.unf.Base64Encoding.java
/** * * @param digest byte array for encoding in base 64, * @param chngByteOrd boolean indicating if to change byte order * @return String the encoded base64 of digest *///from ww w .j ava 2 s. c om public static String tobase64(byte[] digest, boolean chngByteOrd) { byte[] tobase64 = null; ByteOrder local = ByteOrder.nativeOrder(); String ordbyte = local.toString(); mLog.finer("Native byte order is: " + ordbyte); ByteBuffer btstream = ByteBuffer.wrap(digest); btstream.order(ByteOrder.BIG_ENDIAN); byte[] revdigest = null; if (chngByteOrd) { revdigest = changeByteOrder(digest, local); } if (revdigest != null) { btstream.put(revdigest); } else { btstream.put(digest); } tobase64 = Base64.encodeBase64(btstream.array()); return new String(tobase64); }