java/src/org/openantivirus/util PatternFinder.java,1.16,1.17

Kurt Huwig <[email protected]> Sun, 19 Sep 2004 14:01:41 +0000
Newsgroups gmane.comp.security.virus.openantivirus.cvs
Message-ID <[email protected]>
Update of /cvsroot/openantivirus/java/src/org/openantivirus/util
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12699/java/src/org/openantivirus/util

Modified Files:
	PatternFinder.java 
Log Message:
Replaced custom hex-conversion code with call to Java lib

Index: PatternFinder.java
===================================================================
RCS file: /cvsroot/openantivirus/java/src/org/openantivirus/util/PatternFinder.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- PatternFinder.java	18 May 2004 09:03:30 -0000	1.16
+++ PatternFinder.java	19 Sep 2004 14:01:39 -0000	1.17
@@ -528,8 +528,9 @@
         RandomAccessFile ras = new RandomAccessFile(sFilename, "r");
         ras.seek(lStart);
         do {
-            String sHex = Integer.toHexString(ras.read());
-            System.out.print(("0" + sHex).substring(sHex.length() - 1));
+            final int value = ras.read();
+            System.out.print(Character.forDigit(value >> 4, 16)
+                             + Character.forDigit(value % 0x0f, 16));
         } while (++lStart <= lEnd);
         ras.close();
     }



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php