public ReadableBufferReader(ReadableBuffer buffer) : this(buffer.Start, buffer.End)
 {
 }
 internal PreservedBuffer(ref ReadableBuffer buffer)
 {
     _buffer = buffer;
 }
示例#3
0
 /// <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);
 }
示例#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));
        }