public SegmentStream(BufferSegment segment) { this._segment = segment; this.m_Position = this._segment.Offset; }
public Client() { Sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _bufferSegment = Buffers.CheckOut(); Receive(); }
public Client(Socket _sock) { this.Sock = _sock; _bufferSegment = Buffers.CheckOut(); Receive(); }
/// <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); }