You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flume.apache.org by "Miroslav Holubec (JIRA)" <ji...@apache.org> on 2015/03/03 15:32:04 UTC

[jira] [Updated] (FLUME-2593) ResettableFileInputStream returns negate values from read() method

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

Miroslav Holubec updated FLUME-2593:
------------------------------------
    Description: 
the int value returned from the method should be in range 0-255 for a byte read, or -1 when EOF was reached, as described in InputStream class javadoc.

Fix is to change the line in read() method:
{noformat}
 return byteBuf[0];
{noformat}
to
{noformat}
 return byteBuf[0] & 0xFF;
{noformat}

  was:
the int value returned from the method should be in range 0-255 for a byte read, or -1 when EOF was reached, as described in InputStream class javadoc.

Fix is to change the line in read() method:
{noformat}
 return byteBuf[0];
{noformat}
to
{noformat}
 return byteBuf[0] && 0xFF;
{noformat}


> ResettableFileInputStream returns negate values from read() method
> ------------------------------------------------------------------
>
>                 Key: FLUME-2593
>                 URL: https://issues.apache.org/jira/browse/FLUME-2593
>             Project: Flume
>          Issue Type: Bug
>    Affects Versions: v1.5.2
>            Reporter: Miroslav Holubec
>            Priority: Minor
>
> the int value returned from the method should be in range 0-255 for a byte read, or -1 when EOF was reached, as described in InputStream class javadoc.
> Fix is to change the line in read() method:
> {noformat}
>  return byteBuf[0];
> {noformat}
> to
> {noformat}
>  return byteBuf[0] & 0xFF;
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)