Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Steven Simpson Newsgroups: comp.lang.java.programmer Subject: Re: A stream/pipe that fills only on demand... Date: Fri, 07 Nov 2014 10:00:26 +0000 Organization: A noiseless patient Spider Lines: 15 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: mx02.eternal-september.org; posting-host="61edfae3edc21d490b2d8c754e2a2d8f"; logging-data="28154"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kOTTs0cnzIZe5bpZZV3lIjJouBTHhnE0=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: Cancel-Lock: sha1:vX0P0eBIRggXYQ7b5gcp+49TfX8= Xref: csiph.com comp.lang.java.programmer:30307 On 07/11/14 09:34, Andreas Leitgeb wrote: > My needs are a bit different, though: I need a pipe-stream > that recognizes reader's request for bytes, and tells the > writer-end about the requested volume, and then the writer > will write just as much into the pipe as is needed by the > reader. The reader just uses the normal API that InputStream > offers, but I need these calls to identify themselves to the > pipe-writer, which would use a (yet unspecified) special API, > so the writer knows how much to put into the pipe-stream. Surely, that special API is InputStream itself...? -- ss at comp dot lancs dot ac dot uk