示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BufferReader"/> class using the buffer already filled in by the specified <see cref="BufferWriter"/>.
 /// Note that the underlying buffer is shared, and the writer could corrupt it.
 /// </summary>
 /// <param name="writer">The writer to share the buffer with.</param>
 public BufferReader(BufferWriter writer)
 {
     this.buffer          = writer.Buffer;
     this.length          = writer.Position;
     this.currentPosition = 0;
 }