Here you can find the source of ASCIIToHex(int args, int len)
Parameter | Description |
---|---|
args | a parameter |
len | a parameter |
public static String ASCIIToHex(int args, int len)
//package com.java2s; //License from project: Apache License public class Main { /**// w w w . ja va 2 s . co m * * @param args * * @param len * * @return */ public static String ASCIIToHex(int args, int len) { String str = Integer.toHexString(args); if (str.length() < len) { while (str.length() < len) { if (str.length() == len) { return str; } str = "0" + str; } } return str.toUpperCase(); } }