You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Rich Scheuerle (JIRA)" <ji...@apache.org> on 2007/04/14 00:07:15 UTC

[jira] Commented: (WSCOMMONS-118) BoundaryDelimitedStream read(byte[] b) only works with b.length == 1

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

Rich Scheuerle commented on WSCOMMONS-118:
------------------------------------------

The BoundaryDelimitedStream code needs to be updated to use the ByteSearch utility.

Does anyone else want to volunteer to make these changes ?

> 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
>         Assigned To: Rich Scheuerle
>         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: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org