Añado los fuentes de java
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.tarisan.util;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
||||
public class conversiones {
|
||||
|
||||
public static String toHexadecimal(String sData){
|
||||
byte [] datos = sData.getBytes();
|
||||
String resultado="";
|
||||
ByteArrayInputStream input = new ByteArrayInputStream(datos);
|
||||
String cadAux;
|
||||
int leido = input.read();
|
||||
while(leido != -1){
|
||||
cadAux = Integer.toHexString(leido);
|
||||
if(cadAux.length()<2){
|
||||
resultado += "0";
|
||||
}
|
||||
resultado += cadAux;
|
||||
leido = input.read();
|
||||
}
|
||||
return resultado.toUpperCase();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user