From: Googy Date: 2007-06-29T23:50:04+09:00 Subject: Re: java ByteArrayOutputStream alternative in ruby. On Jun 29, 5:55 pm, James Edward Gray II wrote: > On Jun 29, 2007, at 6:25 AM, Googy wrote: > > > I am porting a library from java to ruby. My problem is simulating > > ByteArrayOutputStream in ruby. I want to pack bytes integers and all > > other kinds of data in to a stream buffer then get it as a packed > > string and send it over network. > > Look-up Array#pack in your favorite documentation source. > > James Edward Gray II Yeah, Did that before. But My problem is I collect binary data as the program runs and then send it over the network. So I want to know if there are any classes proving in memory streams. I have one more doubt, how do you concatenate two packed values, for e.g you pack some stuff into a string at one location, and in some other location you pack another chunk of binary data. And how do you concatenate those two packed values, is normal string concatenation is sufficient for concatenating two chunks of binary data packed in strings ?