Here you can find the source of convertArrayListToHexString(ArrayList
Parameter | Description |
---|---|
ArrayList | that needs to be converted to a HEX-Formated String |
public static String convertArrayListToHexString(ArrayList<Byte> al)
//package com.java2s; /**/*from w w w.j a va 2 s . c o m*/ * KMIPUtils.java * ----------------------------------------------------------------- * __ __ __ ___________ * / //_// |/ / _/ __ \ .--. * / ,< / /|_/ // // /_/ / /.-. '----------. * / /| |/ / / // // ____/ \'-' .--"--""-"-' * /_/ |_/_/ /_/___/_/ '--' * * ----------------------------------------------------------------- * Description for class * This class is a collection of multiple used functions * * @author Stefanie Meile <stefaniemeile@gmail.com> * @author Michael Guster <michael.guster@gmail.com> * @org. NTB - University of Applied Sciences Buchs, (CH) * @copyright Copyright ? 2013, Stefanie Meile, Michael Guster * @license Simplified BSD License (see LICENSE.TXT) * @version 1.0, 2013/08/09 * @since Class available since Release 1.0 * * */ import java.util.ArrayList; import java.util.List; public class Main { /** * @param ArrayList that needs to be converted to a HEX-Formated String * @return HEX-formated String */ public static String convertArrayListToHexString(ArrayList<Byte> al) { StringBuffer buf = new StringBuffer(); for (Byte b : al) { buf.append(String.format("%02X", b)); } return buf.toString(); } /** * @param List<Byte> that needs to be converted to a HEX-Formated String * @return HEX-formated String */ public static String convertArrayListToHexString(List<Byte> al) { StringBuffer buf = new StringBuffer(); for (Byte b : al) { buf.append(String.format("%02X", b)); } return buf.toString(); } }