Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #8504

Re: Buffered reading seems to corrupt data stream

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe20.iad.POSTED!83aa503d!not-for-mail
From Daniel Pitts <newsgroup.nospam@virtualinfinity.net>
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: Buffered reading seems to corrupt data stream
References <y4Cdne-uvN4kUBTTnZ2dnUVZ_hWdnZ2d@westnet.com.au> <IfmdnSISO4_8SRTTnZ2dnUVZ_qmdnZ2d@westnet.com.au> <pe2pl8-h72.ln1@groombridge34.de> <beadnUUr7Oe0ixfTnZ2dnUVZ_oednZ2d@westnet.com.au>
In-Reply-To <beadnUUr7Oe0ixfTnZ2dnUVZ_oednZ2d@westnet.com.au>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 8bit
Lines 24
Message-ID <oMoiq.2735$eF7.759@newsfe20.iad> (permalink)
X-Complaints-To abuse@newsrazor.net
NNTP-Posting-Date Mon, 03 Oct 2011 20:18:28 UTC
Date Mon, 03 Oct 2011 13:18:27 -0700
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8504

Show key headers only | View raw


On 10/3/11 1:07 PM, Qu0ll wrote:
> "Ronny Schütz" wrote in message news:pe2pl8-h72.ln1@groombridge34.de...
>
>> It might be, that the BufferedInputStream used for the first read
>> already read data belonging to the second message, that will get lost
>> when you dispose the BufferedInputStream and will be missing from the
>> next read call. The garbage size read is most likely actually a part of
>> the payload bytes. Try to synchronize server and client somehow to
>> verify. Better reuse the complete stream chain.
>
> Thanks Ronny. Could you please explain what you mean by "reuse the
> complete stream chain"?
>
> --
> And loving it,
>
> -Qu0ll (Rare, not extinct)
> _________________________________________________
> Qu0llSixFour@gmail.com
> [Replace the "SixFour" with numbers to email me]
He means specifically not creating a new BufferedInputStream (or any 
stream) each time you are reading it.  You should only have one instance 
of BufferedInputStream, which should be stored along-side the original 
input stream (or socket, or whatever).

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Buffered reading seems to corrupt data stream "Qu0ll" <Qu0llSixFour@gmail.com> - 2011-10-04 01:58 +1100
  Re: Buffered reading seems to corrupt data stream "Qu0ll" <Qu0llSixFour@gmail.com> - 2011-10-04 02:26 +1100
    Re: Buffered reading seems to corrupt data stream Ronny Schütz <usenet.r96@gishpuppy.com> - 2011-10-03 17:54 +0200
      Re: Buffered reading seems to corrupt data stream "Qu0ll" <Qu0llSixFour@gmail.com> - 2011-10-04 07:07 +1100
        Re: Buffered reading seems to corrupt data stream Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-10-03 13:18 -0700
      Re: Buffered reading seems to corrupt data stream "Qu0ll" <Qu0llSixFour@gmail.com> - 2011-10-04 10:54 +1100
    Re: Buffered reading seems to corrupt data stream Roedy Green <see_website@mindprod.com.invalid> - 2011-10-03 11:46 -0700
  Re: Buffered reading seems to corrupt data stream Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-10-03 08:44 -0700
  Re: Buffered reading seems to corrupt data stream markspace <-@.> - 2011-10-03 11:33 -0700
    Re: Buffered reading seems to corrupt data stream Lew <lewbloch@gmail.com> - 2011-10-04 08:48 -0700
      Re: Buffered reading seems to corrupt data stream Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-10-04 09:07 -0700
        Re: Buffered reading seems to corrupt data stream Lew <lewbloch@gmail.com> - 2011-10-04 12:06 -0700

csiph-web