Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5A29D200AED for ; Tue, 3 May 2016 23:12:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 58F181609F6; Tue, 3 May 2016 23:12:15 +0200 (CEST) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BAAE71609A9 for ; Tue, 3 May 2016 23:12:14 +0200 (CEST) Received: (qmail 87531 invoked by uid 500); 3 May 2016 21:12:13 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 87062 invoked by uid 99); 3 May 2016 21:12:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 May 2016 21:12:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 08C212C1F64 for ; Tue, 3 May 2016 21:12:13 +0000 (UTC) Date: Tue, 3 May 2016 21:12:13 +0000 (UTC) From: "Luca Tabone (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CXF-6891) IOUtils.isEmpty() doesn't reinclude byte in stream. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 03 May 2016 21:12:15 -0000 [ https://issues.apache.org/jira/browse/CXF-6891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Luca Tabone updated CXF-6891: ----------------------------- Component/s: JAX-RS > 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: JAX-RS, Tooling > Affects Versions: 3.1.6 > Reporter: Luca Tabone > Attachments: cxf-bug.zip > > > 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). > Find attached Maven Project containing 2 test cases. > 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)