public ReadableBufferReader(ReadableBuffer buffer) : this(buffer.Start, buffer.End)
 {
 }
 internal PreservedBuffer(ref ReadableBuffer buffer)
 {
     _buffer = buffer;
 }
 /// <summary>
 /// Appends the <see cref="ReadableBuffer"/> to the <see cref="WritableBuffer"/> in-place without copies.
 /// </summary>
 /// <param name="buffer">The <see cref="ReadableBuffer"/> to append</param>
 public void Append(ReadableBuffer buffer)
 {
     _pipe.Append(buffer);
 }
Example #4
0
        /// <summary>
        /// This transfers ownership of the buffer from the <see cref="IPipeReader"/> to the caller of this method. Preserved buffers must be disposed to avoid
        /// memory leaks.
        /// </summary>
        public PreservedBuffer Preserve()
        {
            var buffer = new ReadableBuffer(ref this);

            return(new PreservedBuffer(ref buffer));
        }