Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 23499 invoked from network); 30 Jan 2007 03:06:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jan 2007 03:06:02 -0000 Received: (qmail 58767 invoked by uid 500); 30 Jan 2007 03:06:07 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 58749 invoked by uid 500); 30 Jan 2007 03:06:07 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 58740 invoked by uid 99); 30 Jan 2007 03:06:07 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 19:06:07 -0800 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=RCVD_IN_NJABL_PROXY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [208.176.63.108] (HELO ext1-chi.ldsys.net) (208.176.63.108) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 19:05:57 -0800 Received: from [192.168.100.3] (200-150-162-71.interair.com.br [200.150.162.71]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ext1-chi.ldsys.net (Postfix) with ESMTP id 54732B8018 for ; Mon, 29 Jan 2007 21:05:36 -0600 (CST) Message-ID: <45BEB5F4.4010205@ldsys.net> Date: Tue, 30 Jan 2007 01:05:24 -0200 From: "Christopher G. Stach II" User-Agent: Thunderbird 1.5.0.9 (X11/20061219) MIME-Version: 1.0 To: activemq-users@geronimo.apache.org Subject: Re: Possible bug in activeMQ4.1.0 with Streams? References: <8702029.post@talk.nabble.com> In-Reply-To: <8702029.post@talk.nabble.com> X-Enigmail-Version: 0.94.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org cafe wrote: > I have a simple program that sends a stream to a queue, > > … > OutputStream out = connection.createOutputStream(destination); > > File file = new File("D:/file.xml"); > > FileInputStream fis = new FileInputStream(file); > > int l; > byte[] array = new byte[1024]; > > while ( (l = fis.read(array)) != -1 ){ > out.write(array); > > } > > > > And in the other side a simple program who receive the stream: > > InputStream fis = connection.createInputStream(destination); > FileOutputStream out = new FileOutputStream("D:/Newfile.xml"); > > int l; > byte[] array= new byte[1024]; > > while ((l = fis.read(array)) > 0) { > out.write(array); > } > > > The problem is that activeMQ is putting more bytes to the stream, for > example I have run these programs with the following input (file.xml): > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > > And I obtain the following file (NewFile.xml) > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ _______ > > note: the line above are the byte added by activeMQ > > What could be this? > > You're using the wrong ``write'' method. -- Christopher G. Stach II