HttpMultipartParser.RebufferableBinaryReader.Buffer C# (CSharp) Method

Buffer() public method

Adds data to the front of the stream. The most recently buffered data will be read first.
public Buffer ( byte data ) : void
data byte /// The data to buffer. ///
return void
        public void Buffer(byte[] data)
        {
            streamStack.Push(data);
        }

Same methods

RebufferableBinaryReader::Buffer ( string data ) : void

Usage Example

Beispiel #1
0
        /// <summary>
        /// Detects the boundary from the input stream. Assumes that the
        ///     current position of the reader is the start of the file and therefore
        ///     the beginning of the boundary.
        /// </summary>
        /// <param name="reader">
        /// The binary reader to parse
        /// </param>
        /// <returns>
        /// The boundary string
        /// </returns>
        private static string DetectBoundary(RebufferableBinaryReader reader)
        {
            // Presumably the boundary is --|||||||||||||| where -- is the stuff added on to
            // the front as per the protocol and ||||||||||||| is the part we care about.
            var boundary = string.Concat(reader.ReadLine().Skip(2));

            reader.Buffer("--" + boundary + "\n");
            return(boundary);
        }
All Usage Examples Of HttpMultipartParser.RebufferableBinaryReader::Buffer