Exemplo n.º 1
0
		public static int ReadBody(IApiReadBody readBody, byte[] buffer)
		{
			int size = 0;
			var internalBuffer = new byte[256];
			while(true)
			{
				var count = readBody.ReadBytes(internalBuffer);
				if(count == 0)
					break;
				Array.Copy(internalBuffer, 0, buffer, size, count);
				size += count;
			}
			return size;
		}
Exemplo n.º 2
0
        public static int ReadBody(IApiReadBody readBody, byte[] buffer)
        {
            int size           = 0;
            var internalBuffer = new byte[256];

            while (true)
            {
                var count = readBody.ReadBytes(internalBuffer);
                if (count == 0)
                {
                    break;
                }
                Array.Copy(internalBuffer, 0, buffer, size, count);
                size += count;
            }
            return(size);
        }