logo       

java/src/org/openantivirus/scanner/scanobject TemporaryScanObject.java,1.3,: msg#00007

Subject: java/src/org/openantivirus/scanner/scanobject TemporaryScanObject.java,1.3,1.4 FileScanObject.java,1.2,1.3
Update of /cvsroot/openantivirus/java/src/org/openantivirus/scanner/scanobject
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20313/src/org/openantivirus/scanner/scanobject

Modified Files:
        TemporaryScanObject.java FileScanObject.java 
Log Message:
Removed unused imports
Fixed problems found by FindBugs

Index: TemporaryScanObject.java
===================================================================
RCS file: 
/cvsroot/openantivirus/java/src/org/openantivirus/scanner/scanobject/TemporaryScanObject.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- TemporaryScanObject.java    20 May 2002 13:10:35 -0000      1.3
+++ TemporaryScanObject.java    1 May 2004 14:36:11 -0000       1.4
@@ -32,8 +32,6 @@
  * @version $Revision$
  */
 public class TemporaryScanObject extends ScanObject {
-    public static final String VERSION =
-        "$Id$";
     
     private static final String
             TEMP_PREFIX = "file",
@@ -52,31 +50,33 @@
         file = createTempFile(directory);
         
         final OutputStream os = new FileOutputStream(file);
-        
-        // read the start of the stream
-        int pos = 0;
-        byte[] buffer = new byte[BUFFER_SIZE];
-        int read;
-        while ((read = is.read(buffer, pos, MAX_START_SIZE - pos))
-               != -1) {
-            os.write(buffer, pos, read);
-            pos += read;
-            if (pos == MAX_START_SIZE) {
-                break;
+        try {
+            // read the start of the stream
+            int pos = 0;
+            byte[] buffer = new byte[BUFFER_SIZE];
+            int read;
+            while ((read = is.read(buffer, pos, MAX_START_SIZE - pos))
+                   != -1) {
+                os.write(buffer, pos, read);
+                pos += read;
+                if (pos == MAX_START_SIZE) {
+                    break;
+                }
             }
+            
+            // copy the start into the start-array
+            start = new byte[pos];
+            for (int i = 0; i < pos; i++) {
+                start[i] = buffer[i];
+            }
+            
+            // read the rest of the stream
+            while ((read = is.read(buffer)) != -1) {
+                os.write(buffer, 0, read);
+            }
+        } finally {
+            os.close();
         }
-        
-        // copy the start into the start-array
-        start = new byte[pos];
-        for (int i = 0; i < pos; i++) {
-            start[i] = buffer[i];
-        }
-        
-        // read the rest of the stream
-        while ((read = is.read(buffer)) != -1) {
-            os.write(buffer, 0, read);
-        }
-        os.close();
     }
 
     protected File createTempFile(File directory) throws IOException {

Index: FileScanObject.java
===================================================================
RCS file: 
/cvsroot/openantivirus/java/src/org/openantivirus/scanner/scanobject/FileScanObject.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- FileScanObject.java 20 May 2002 13:10:35 -0000      1.2
+++ FileScanObject.java 1 May 2004 14:36:11 -0000       1.3
@@ -32,8 +32,6 @@
  * @version $Revision$
  */
 public class FileScanObject extends ScanObject {
-    public static final String VERSION =
-        "$Id$";
     
     private final File file;
     



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe