Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Invalid
-
None
-
None
-
None
Description
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.flush();
fileOutStream.close();
} catch (IOException e)
}