From: gabriele renzi Date: 2003-08-01T09:05:16+09:00 Subject: Re: Reading an integer out of 1..3 bytes il 31 Jul 2003 21:21:00 GMT, Mike Hall ha scritto:: > >> is there a rubysh way of reading 1,2 or 3 bytes >>on an integer from an IO? > >Like with String 'unpack'? > > str.unpack( format ) -> anArray >------------------------------------------------------------------------ > Decodes str (which may contain binary data) according to the format > string, returning an array of each value extracted. possibly.. but how actually use it? I could read a string of 1 or 2 or 3 bytes, and use a case ? and what format should I use? I suppose this is a reeeeally dumb question, but I never really got unpack :(