il 31 Jul 2003 21:21:00 GMT, Mike Hall <mghall / enteract.com> 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 :(