예제 #1
0
 public FilePacketArray(FilePacketArray copyFrom)
 {
     Index  = copyFrom.Index;
     Buffer = new byte[copyFrom.Buffer.Length];
     System.Buffer.BlockCopy(copyFrom.Buffer, 0, Buffer, 0, copyFrom.FilledLength);
     FilledLength = copyFrom.FilledLength;
 }
예제 #2
0
        public void CopyTo(FilePacketArray destination)
        {
            Debug.Assert(destination.Buffer != null, $"{nameof(destination)}.{nameof(destination.Buffer)} is null");
            Debug.Assert(destination.Buffer.Length >= FilledLength, $"{nameof(destination)}.{nameof(destination.Buffer)} could not be less than source ${nameof(FilledLength)}");

            destination.Index = Index;
            System.Buffer.BlockCopy(Buffer, 0, destination.Buffer, 0, FilledLength);
            destination.FilledLength = FilledLength;
        }