public void TestStreamAndArrayHashMatchOne() { LargeMemoryStream.Position = 0; ActualString = HashInstance.ComputeStream(LargeMemoryStream).ToString(); ExpectedString = HashInstance.ComputeBytes(LargeMemoryStream.ToArray()).ToString(); AssertAreEqual(ExpectedString, ActualString); }
public void TestStreamAndArrayHashMatchTwo() { LargeMemoryStream.Position = 0; ActualString = HashInstance.ComputeStream(LargeMemoryStream, LargeMemoryStream.Length / 2).ToString(); HashInstance.Initialize(); HashInstance.TransformBytes(LargeMemoryStream.ToArray(), 0, (int)(LargeMemoryStream.Length / 2)); ExpectedString = HashInstance.TransformFinal().ToString(); AssertAreEqual(ExpectedString, ActualString); }
/// <summary> /// Imports in memory <see cref="DicomFile"/> to a remote server. /// </summary> /// <param name="callingAETitle">AE title of the local application.</param> /// <param name="calledAeTitle">AE title of the remote server</param> /// <param name="file">The DICOM file to import</param> /// <returns></returns> public ImportSopResponse ImportFile(string callingAETitle, string calledAeTitle, DicomFile file) { var request = new ImportSopRequest { CallingAETitle = callingAETitle, CalledAETitle = calledAeTitle, SopInstanceUid = file.DataSet[DicomTags.SopInstanceUid].ToString(), }; using (var stream = new LargeMemoryStream()) { file.Save(stream, DicomWriteOptions.Default); request.SopInstance = stream.ToArray(); } var response = ImportSop(request); return(response); }