Return-Path: Mailing-List: contact general-help@xml.apache.org; run by ezmlm Delivered-To: mailing list general@xml.apache.org Received: (qmail 17421 invoked from network); 21 Dec 2000 05:01:55 -0000 Received: from nr7-216-68-174-18.fuse.net (HELO mail.danowski.net) (216.68.174.18) by locus.apache.org with SMTP; 21 Dec 2000 05:01:55 -0000 Received: from apache.org ([63.211.145.10]) by mail.danowski.net (MERAK 2.10.331) with ESMTP id for ; Thu, 21 Dec 2000 00:08:06 -0500 Message-ID: <3A418DF8.98F7DD00@apache.org> Date: Wed, 20 Dec 2000 20:58:32 -0800 From: Andy Clark X-Mailer: Mozilla 4.76 [en] (WinNT; U) X-Accept-Language: en,ja MIME-Version: 1.0 To: general@xml.apache.org Subject: Re: Reading XML from a Socket (WrappedInputStream) References: <00121911162800.25890@ibiza> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Ahmad Morad wrote: > In my code i read XML Data from the InputStream of a socket. But > in some cases, i read also standard text data from the socket. So > i need a method, which reads the complete message from the stream > and returns the result as a string. I use the following code in > my application: You don't have enough code in your post for me to accurately deduce your problem. However, there are a few things I can suggest. First, are you calling the WrappedOutputStream#close method on the output? Also, perhaps the following code should be changed from this: while ((count = wf.read(fBuffer,0, length)) > 0) to this: while ((count = wf.read(fBuffer,0, length)) != -1) Lastly, perhaps there's a bug in my sample code. Although, I didn't see problems like this before. -- Andy Clark * IBM, TRL - Japan * andyc@apache.org