Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!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: Sun, 27 Nov 2011 21:43:32 +0100 Lines: 36 Message-ID: <9jflnkFnrgU1@mid.individual.net> References: <4ed0101b$0$282$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: individual.net L5aPsWb2/pDUAnR9WHZRwAG9jM+OujNDrcVfwOgmysawVDwm8= Cancel-Lock: sha1:CYZD/eK6JV5Sf5X0C+0Mye43YRc= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10281 On 11/26/2011 12:10 PM, Jan Burse wrote: > Arne Vajh=F8j schrieb: >> Use java.nio.ByteBuffer and handle concurrency in your code. > > ByteBuffer does not extend automatically. If I do > put and reach the size of the byte buffer, I will > get an exception BufferOverflowException. > > That is at least how I interpret the javadoc. > > I am not looking for a bounded memory stream, it > should be unbounded, like (temporary) files are. > You just write and write and write, thats it. > > Size control of the memory stream can be done > via close truncate for example. > > The reference to the memory stream should be > still valid when an input stream or output stream > sitting on it does a close. With the same memory > stream reference I should be able to create new > input or output streams over it, that will work > on the previously written content. http://docs.oracle.com/javase/6/docs/api/java/io/PipedInputStream.html http://docs.oracle.com/javase/6/docs/api/java/io/PipedOutputStream.html Still, why do you want to do this? What problem are you trying to=20 solve? I'm not convinced that it is a good idea - especially when using = unbounded buffers. Cheers robert