Recurity.Swf.SwfEncodedU32.SwfReadEncodedU32Data C# (CSharp) Method

SwfReadEncodedU32Data() private static method

Reads an encoded ulong from a given stream
private static SwfReadEncodedU32Data ( BinaryReader source ) : byte[]
source System.IO.BinaryReader Stream to read the value from
return byte[]
        private static byte[] SwfReadEncodedU32Data(BinaryReader source)
        {
            List<byte> bytes = new List<byte>();
            byte b;
            do
            {
                b = source.ReadByte();      // Read one byte from the stream
                bytes.Add(b);               // and add it to the result
                if (bytes.Count == 5)       // if the max. Limit of five bytes is reached
                    break;                  // stop reading any further bytes
            } while ((b & 128) == 128);     // if the msb(128) is set the next byte is part
                                            // of the value
            return bytes.ToArray();         // return the bytes read
        }