From: gabriele renzi Date: 2003-07-30T11:30:55+09:00 Subject: Reading an integer out of 1..3 bytes hi gurus and nubys, I'm working on a tiny dumb client for the Gnutella2/MP network, and I have packets like this: [length of payload_length field][other stuff][payload_length field] ^^header [payload] ^^data now: payload_length can be 1..3 byte, encoded in little endian (same of my platform), is there a rubysh way of reading 1,2 or 3 bytes on an integer from an IO? PS in the spec-draft I can read this example: ReadBytes( (BYTE*)&nPacketLength, nLenLen ); the varname are obvious, but I don't know what kind of code is this and what it actually does..