DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomImage Class / Write Method / Write(Stream,String) Method

The Stream from which to read.

Specifies the full UID of the transfer syntax with which the data is to be saved when Part 10 format is used. If omitted, the little-endian explicit VR transfer syntax is used. For details of the currently supported syntaxes, see .

Example

In This Topic
    Write(Stream,String) Method
    In This Topic
    Write the data to a stream with specified transfer syntax
    Syntax
    'Declaration
     
    
    Public Overloads Sub Write( _
       ByVal Stream As System.IO.Stream, _
       ByVal TransferSyntax As System.String _
    ) 
    public void Write( 
       System.IO.Stream Stream,
       System.string TransferSyntax
    )

    Parameters

    Stream

    The Stream from which to read.

    TransferSyntax

    Specifies the full UID of the transfer syntax with which the data is to be saved when Part 10 format is used. If omitted, the little-endian explicit VR transfer syntax is used. For details of the currently supported syntaxes, see .

    Remarks
    The stream object may subsequently be read by one of the Read method overloads or by other DICOM software.
    Example
    DicomImage image = new DicomImage("your_dicom_image.dcm");
    string transferSyntax = TransferSyntaxes.ExplicitVRLittleEndian; // "1.2.840.10008.1.2.1"
    using (FileStream fs = new FileStream("output_image.dcm", FileMode.Create, FileAccess.Write))
    {
        image.Write(fs, transferSyntax);
    }
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also