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 "Jarek Gawor (JIRA)" <ji...@apache.org> on 2008/12/09 21:01:47 UTC

[jira] Resolved: (WSCOMMONS-320) BAAInputStream.read() returning negative int values

     [ https://issues.apache.org/jira/browse/WSCOMMONS-320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jarek Gawor resolved WSCOMMONS-320.
-----------------------------------

    Resolution: Fixed
      Assignee: Jarek Gawor

Committed a fix for this issue in revision 724854.


> BAAInputStream.read() returning negative int values
> ---------------------------------------------------
>
>                 Key: WSCOMMONS-320
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-320
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Tim Mitchell
>            Assignee: Jarek Gawor
>
> I am running some MTOM tests, and have successfully added an attachment to the SOAP message. On the server side, the Input Stream object returned from the dataHandler, is org.apache.axiom.attachments.utils.BAAInputStream.
> The method I used to read the bytes is:
> int inbytes = inputStream.read();
> if (inbytes == -1)
>   <EOF processing>
> The problem is that the read() method is returning the byte value which can include negative values. The Java spec for InputStream.read() says that this method will return an int with a value of 0 to 255 if a byte was read, or -1 if we've reached the End of Stream. I think that this method just needs to convert the signed values to unsigned ints. i.e. read_byte[0] & 0xFF 

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