cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Tabone (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CXF-6891) IOUtils.isEmpty() doesn't reinclude byte in stream.
Date Tue, 03 May 2016 20:28:13 GMT

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

Luca Tabone updated CXF-6891:
-----------------------------
    Description: 
While trying to integrate Katharsis with CXF I faced a problem related to IOUtils.isEmpty()
method.

When isEmpty is invoked with an InputStream that:
    1. Is not 'mark supported' and
    2. The 'available()' method returns '0'.

The byte that is read from the stream (used to determine whether the stream is empty or not)
is not re-included back to the stream. When I explored the code inside PushbackInputStream
class, I found that the byte is only being included inside the PushbackInputStream.buf (using
unread(byte[], int, int) method).

References:
  > IOUtils: https://cxf.apache.org/javadoc/latest/org/apache/cxf/helpers/IOUtils.html
  > PushbackInputStream: https://docs.oracle.com/javase/7/docs/api/java/io/PushbackInputStream.html
  > Katharsis.io: http://katharsis.io

  was:
While trying to integrate Katharsis with CXF I faced a problem related to IOUtils.isEmpty()
method.

When isEmpty is invoked with an InputStream that:
    1. Is not 'mark supported' and
    2. The 'available()' method returns '0'.

The byte that is read from the stream (used to determine whether the stream is empty or not)
is not re-included back to the stream. When I explored the code inside PushbackInputStream
class, I found that the byte is only being included inside the PushbackInputStream.buf (using
unread(byte[], int, int) method).


> IOUtils.isEmpty() doesn't reinclude byte in stream.
> ---------------------------------------------------
>
>                 Key: CXF-6891
>                 URL: https://issues.apache.org/jira/browse/CXF-6891
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 3.1.6
>            Reporter: Luca Tabone
>
> While trying to integrate Katharsis with CXF I faced a problem related to IOUtils.isEmpty()
method.
> When isEmpty is invoked with an InputStream that:
>     1. Is not 'mark supported' and
>     2. The 'available()' method returns '0'.
> The byte that is read from the stream (used to determine whether the stream is empty
or not) is not re-included back to the stream. When I explored the code inside PushbackInputStream
class, I found that the byte is only being included inside the PushbackInputStream.buf (using
unread(byte[], int, int) method).
> References:
>   > IOUtils: https://cxf.apache.org/javadoc/latest/org/apache/cxf/helpers/IOUtils.html
>   > PushbackInputStream: https://docs.oracle.com/javase/7/docs/api/java/io/PushbackInputStream.html
>   > Katharsis.io: http://katharsis.io



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

Mime
View raw message