skip to main |
skip to sidebar
Declaration String to bytes variable in Smart Card Coding
/**
* This program is really useful for programmer who is so lazy
* to type word/ sentence in bytes when he/she codes in Smart card
*/
import java.lang.*;
/**
* @version 1.0
* @author kapulaga
*
*/
public class stringtobyte {
public stringtobyte(String variablename, String variablevalue)
{
int i;
System.out.print("byte[] "+variablename+"={");
for(i=0;i
{
if(i
System.out.print("'"+variablevalue.charAt(i)+"'"+",");
else
System.out.print("'"+variablevalue.charAt(i)+"'"+"};");
}
}
public static void main(String[] args) {
stringtobyte stb = new stringtobyte("variable","byte value");
}
}