ClearCanvas.Dicom.Network.NetworkBase.CreateFileHeader C# (CSharp) Method

CreateFileHeader() private method

private CreateFileHeader ( byte pcid, DicomAttributeCollection command ) : byte[]
pcid byte
command DicomAttributeCollection
return byte[]
		private byte[] CreateFileHeader(byte pcid, DicomAttributeCollection command)
	    {
		    var msg = new DicomMessage(command, new DicomAttributeCollection());
		    var file = new DicomFile
			    {
				    MediaStorageSopClassUid = msg.AffectedSopClassUid,
				    MediaStorageSopInstanceUid = msg.AffectedSopInstanceUid,
				    ImplementationClassUid = DicomImplementation.ClassUID.UID,
				    ImplementationVersionName = DicomImplementation.Version,
				    SourceApplicationEntityTitle = _assoc.CallingAE,
				    TransferSyntax = _assoc.GetAcceptedTransferSyntax(pcid)
			    };

			var ms = new MemoryStream();
			file.Save(ms,DicomWriteOptions.Default);
			var byteArray = new byte[ms.Length];
			var sourceArray = ms.GetBuffer();
			Array.Copy(sourceArray, 0, byteArray, 0, ms.Length);
			return byteArray;
	    }