Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!74.125.64.80.MISMATCH!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Piggypack Encoding/Decoding on RandomAccessFile Date: Sat, 5 Nov 2011 13:29:38 -0700 (PDT) Organization: http://groups.google.com Lines: 25 Message-ID: <10583905.403.1320524978805.JavaMail.geo-discussion-forums@prfk19> References: <29284695.78.1320512625961.JavaMail.geo-discussion-forums@prok29> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 173.164.137.213 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1320525091 1225 127.0.0.1 (5 Nov 2011 20:31:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 5 Nov 2011 20:31:31 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.213; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9601 On Saturday, November 5, 2011 11:56:06 AM UTC-7, Jan Burse wrote: > Lew schrieb: > > If you need sequential stream access to all or part of > > that data, have sequential clients work with scraps piped > > through the lower-lying direct access instances rather > > than fight over the same prey. >=20 > What is "scraps piped"? How do you eliminate the common prey > through "scraps piped"? Will you not only create a buffering > layer, but the problem will not be evaded? Let's say you want to stream in a UTF-8 entry from the 'RandomAccessFile' (= or any other 'DataInput'). If you attach the stream directly to the file d= escriptor, you have to figure out exactly where to begin somehow or you wil= l not get a validly decoded string. OTOH, the 'DataInput' already knows wh= ere the characters begin, as it reads the source using 'readUTF()'. It can= then make that string available via a 'StringReader' wrapper. And no, the problem of where to start is not "evaded". It's just isolated = to one place. The problem of conflicts between the streamed reader and the= 'DataInput' is completely evaded. --=20 Lew