Example #1
0
 public SegmentStream(BufferSegment segment)
 {
     _segment   = segment;
     m_Position = _segment.Offset;
 }
 /// <summary>
 /// Copys the data in this segment to another <see cref="BufferSegment" />.
 /// </summary>
 /// <param name="segment">the <see cref="BufferSegment" /> instance to copy to</param>
 /// <param name="length">the amount of bytes to copy from this segment</param>
 /// <exception cref="ArgumentException">an ArgumentException will be thrown if length is greater than
 /// the length of the segment</exception>
 public void CopyTo(BufferSegment segment, int length)
 {
     System.Buffer.BlockCopy(Buffer.Array, Offset, segment.Buffer.Array, segment.Offset, length);
 }