Exemplo n.º 1
0
        public void LoadFromString(string input)
        {
            var buffer = new byte[1024];

            using (var s = TlshUtilities.GenerateStreamFromString(input))
            {
                var bytesRead = s.Read(buffer, 0, buffer.Length);
                while (bytesRead > 0)
                {
                    Update(buffer, 0, bytesRead);
                    bytesRead = s.Read(buffer, 0, buffer.Length);
                }
            }
        }
Exemplo n.º 2
0
        public async Task LoadFromStringAsync(string input)
        {
            var buffer = new byte[1024];

            using (var s = TlshUtilities.GenerateStreamFromString(input))
            {
                var bytesRead = await s.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false);

                while (bytesRead > 0)
                {
                    Update(buffer, 0, bytesRead);
                    bytesRead = await s.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false);
                }
            }
        }