ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48313] New: HashvalueAlgorithm assumes available() returns length of file
Date Tue, 01 Dec 2009 05:51:50 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48313

           Summary: HashvalueAlgorithm assumes available() returns length
                    of file
           Product: Ant
           Version: 1.7.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: ndbeyer@apache.org


Created an attachment (id=24646)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24646)
Modifies HashvalueAlgorithm.java to read the entire file

The current implementation of HashvalueAlgorithm uses the
InputStream.available() to determine the number of bytes in the File. The
method available() isn't guaranteed to return the number bytes in the stream,
rather it returns the number of bytes that can be read before blocking.

To correctly read the entire File contents, a looping read must be employed.
I've modified the code to maintain the functionality, but perform a guaranteed
full read of the File.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message