Ajouter un commentaire
ven, 29/06/2007 - 10:22
|
Nefer-IT © 2024. Tous droits réservés
SARL inscrite au RCS de Pontoise, n°797 642 857 siège social : 757, rue de Gisors 95300 Pontoise
Site réalisé par DzMob
Salut j'ai utiliser ca et ca marche bien
public static int bytestoInt(int nb) throws IOException { byte[] bytes = new byte[nb]; inputS.read(bytes); if (bytes == null) { return 0; } StringBuffer hashString = new StringBuffer(); for (int i = 0; i < bytes.length; ++i) { String hex = encodeHex(Integer.toHexString(bytes[i])); if (hex.length() == 1) { hashString.append(hex.charAt(hex.length() - 1)); } else { hashString.append(hex.substring(hex.length() - 2)); } } // return hashString.toString().toUpperCase(); return Integer.parseInt((hashString.toString()), 16); }