ProtocolBuffers.ProtocolParser.ReadBytes C# (CSharp) Method

ReadBytes() public static method

public static ReadBytes ( Stream stream ) : byte[]
stream Stream
return byte[]
        public static byte[] ReadBytes(Stream stream)
        {
            //VarInt length
            uint length = ReadUInt32 (stream);

            //Bytes
            byte[] buffer = new byte[length];
            if(length != 0)
                stream.Read (buffer, 0, buffer.Length);
            return buffer;
        }