DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomDataSet Class / Read Method / Read(Stream,ReadBehaviours) Method

The Stream from which to read.

The behaviours to be used when reading this stream

Example

In This Topic
    Read(Stream,ReadBehaviours) Method
    In This Topic
    Reads from a standard Stream, with specific reading behaviour
    Syntax
    'Declaration
     
    
    Public Overloads Sub Read( _
       ByVal Stream As System.IO.Stream, _
       ByVal Behaviour As ReadBehaviours _
    ) 
    public void Read( 
       System.IO.Stream Stream,
       ReadBehaviours Behaviour
    )

    Parameters

    Stream

    The Stream from which to read.

    Behaviour

    The behaviours to be used when reading this stream

    Remarks

    This is a variation on the standard Read(Stream) method which allows control of specific behaviour (normally to cope with bugs in the recieved data) on an operation by operation bases.

    The stream may have been written by the Write method or by other DICOM software.

    It is the caller's responsibility to position the stream correctly before calling this method - no rewind is done internally.

    This in the only method to provide this additional Behaviour parameter, but all other Read opeations may be performed by creating a suitable stream from the file, byte[] etc., and using a null Password if necessary.

    Example
    using (FileStream fs = new FileStream("Dataset.dcm"", FileMode.Open, FileAccess.Read))
    {
        DicomDataSet ds = new DicomDataSet();
        ds.Read(fs, new ReadBehaviours() { IgnoreAfterPixels = true, DontReadPixels = true }); 
    }
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also