From: Eric Hodel Date: 2009-08-13T14:22:42+09:00 Subject: Re: in-memory implementation of IO class On Aug 12, 2009, at 20:34, Nathan Beyer wrote: > On Wed, Aug 12, 2009 at 10:15 PM, James > Gray wrote: >> On Aug 12, 2009, at 10:07 PM, Nathan Beyer wrote: >> >>> Is there an implementation of the IO class that operates on in- >>> memory >>> byte arrays (or other data structure)? I haven't seen anything in >>> the >>> core/stdlib. >> >> Yes, see the standard StringIO library. >> >> James Edward Gray II > > Excuse my ignorance -- I'm just getting into Ruby, but isn't the > StringIO for working with character data? Is there no distinction > between characters and bytes? I was assuming that StringIO and String > would cause some form of character encoding/decoding processing to > kick in. In ruby 1.8 no. In ruby 1.9 set the encoding to binary.