>>>>> "P" == Pixel  <pixel / mandrakesoft.com> writes:

 Well, if I'm right :

P> p "\0\0\0\0".unpack("b16b1b2") # -> ["0000000000000000", "0", "00"]

   unpack b16 from \0\0 
   unpack b1  from \0
   unpack b2  from \0

 here a little example :

moulon% ruby -e 'p "\0\0\1\3\1".unpack("b16b1b2b1")'
["0000000000000000", "1", "11", "1"]
moulon% 

P> p "\0\0\0\0".unpack("b17b1b1") # -> ["00000000000000000", "0", ""]

   unpack b17 from \0\0\0 (only 16 bits in \0\0 ==> it take the 17 bit in
                           the next \0)

   unpack b1  from \0
   unpack b1  from (nothing)


Guy Decoux