axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Liyu Yi (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2-2516) Poor performance of File Caching caused by PartOnFile
Date Thu, 12 Apr 2007 17:28:32 GMT
Poor performance of File Caching caused by PartOnFile
-----------------------------------------------------

                 Key: AXIS2-2516
                 URL: https://issues.apache.org/jira/browse/AXIS2-2516
             Project: Axis 2.0 (Axis2)
          Issue Type: Improvement
          Components: om
            Reporter: Liyu Yi


I noticed that the performance of "File Caching" is not great, and I believe it is due to
the implementation of  the constructor of "org.apache.axiom.attachments.PartOnFile" which
reads and writes the inputSteam byte-by-byte (see the snippets below). Can we simply apply
some buffering to improve it?

    public PartOnFile(PushbackFilePartInputStream inStream, String repoDir) {
            ...            
            cacheFile = File.createTempFile("Axis2", ".att",
                    repoDirFile);

            FileOutputStream fileOutStream = new FileOutputStream(cacheFile);
            int value;
            value = parseTheHeaders(inStream);
            fileOutStream.write(value);
            while (!inStream.getBoundaryStatus()) {
                value = inStream.read();
                if (!inStream.getBoundaryStatus()) {
                    fileOutStream.write(value);
                }
            }

            fileOutStream.flush();
            fileOutStream.close();
        } catch (IOException e) {
            throw new OMException("Error creating temporary File.", e);
        }
    }



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message