コード例 #1
0
        public MultipartReader(Stream stream, HttpContentHeaders headers,
                               int bufferSize = DelimitedBuffer.DefaultBufferSize)
        {
            _buffer = new DelimitedBuffer(stream, bufferSize);

            var boundary = headers.GetContentBoundry();

            if (boundary.IsNullOrEmpty())
            {
                throw new ArgumentException("No boundry specified in the content-type header.");
            }

            _boundary     = $"--{boundary}".ToBytes();
            _boundaryLine = $"\r\n--{boundary}".ToBytes();
        }