[ 
https://issues.apache.org/jira/browse/WSCOMMONS-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471012
 ] 

Ralf Gueldemeister commented on WSCOMMONS-118:
----------------------------------------------

I can confirm the bug when accessing the BoundaryDelimitedStream through 
IncomingAttachmentInputStream. The proposed patch fixes the problem. Please 
include the patch in the next release, otherwise the Attachment API for SwA is 
not usable (at least for attachments bigger than the initial buffer size).

> BoundaryDelimitedStream read(byte[] b) only works with b.length == 1
> --------------------------------------------------------------------
>
>                 Key: WSCOMMONS-118
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-118
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Holger Lange
>         Attachments: BoundaryDelimitedStreamTestCase.zip
>
>
> With the current trunk the stream cannot be read correctly if b.length > 1. 
> This patch seems to fix it:
> Index: .
> ===================================================================
> --- . (revision 469843)
> +++ . (working copy)
> @@ -262,7 +262,7 @@
>              boundaryPos = boundaryPosition(readbuf, 0, readBufEnd);
>          }
>  
> -        int bwritten = -1;    // Number of bytes written.
> +        int bwritten = 0;    // Number of bytes written.
>  
>          // read and copy bytes in.
>          do {                                // Always allow to have a 
> boundary length left in the buffer.
> @@ -267,7 +267,6 @@
>          // read and copy bytes in.
>          do {                                // Always allow to have a 
> boundary length left in the buffer.
>  
> -             bwritten = 0;
>              int bcopy = Math.min(readBufEnd - readBufPos - boundaryBufLen,
>                      len - bwritten);
>  

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to