[ https://issues.apache.org/jira/browse/WSCOMMONS-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12892887#action_12892887 ]
Andreas Veithen commented on WSCOMMONS-555: ------------------------------------------- This issue only occurs with fileTreshold < 1024 (which is an unusual setting). It is caused by the following code in PartFactory#createPart: InputStream dross = readHeaders(in, headers); ... int t1 = BufferUtils.inputStream2OutputStream(dross, baaos, thresholdSize); int t2 = BufferUtils.inputStream2OutputStream(in, baaos, thresholdSize - t1); The input stream returned by readHeaders contains between 0 and 1024 bytes. However, the code further down doesn't take into account that the number of bytes in this stream may be larger than thresholdSize. Therefore, if thresholdSize is smaller than 1024, there is no guarantee that all the data from the stream is copied to baaos, and the bytes remaining in the stream are lost. > saveOnFile=true will alter attachments > -------------------------------------- > > Key: WSCOMMONS-555 > URL: https://issues.apache.org/jira/browse/WSCOMMONS-555 > Project: WS-Commons > Issue Type: Bug > Components: AXIOM > Affects Versions: Axiom 1.2.8 > Environment: Java 1.5 > Reporter: Lorenzo > Attachments: TESTWithAttachments.zip > > > Hi all, > working with SWA messages i found this strange error: > i build messages with attachment with saveAttachmentsOnFile option set true > when i write the message back, attachments are modified... > If i try with saveAttachmentsOnFile at false, it works fine. > The really strange thing is how attachments are changed... hard to explain, > just run the test. > Lorenzo -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.