Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Fav. Memory Stream Impl. Date: Fri, 25 Nov 2011 23:22:26 +0100 Lines: 28 Message-ID: <9jaip4FpgtU1@mid.individual.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net X1yYS05I5X0SWDosFVeiqA2CVTQIrcaD38L198Lx5SEY2z0Tg= Cancel-Lock: sha1:bG5m4OeFMfx+6IeHY6nMVZTsYMU= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10244 On 25.11.2011 22:36, Jan Burse wrote: > Jan Burse schrieb: >> The memory stream should be sharable. > > Well to some extend ByteArrayOutputStream and > ByteArrayInputStream are shareble. They are > at least thread safe, I find: > > public synchronized void write(int b) { > > So the same output object can be used by multiple > threads. And the same input object can be used > by multiple threads. > > But I would like to be able to do the same as with > a temporary file. Some threads open it for read, > and some threads open it for write. Why do you want to do that with binary data? What is your use case? Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/