org.dicom4j.io
Class DicomReader

java.lang.Object
  extended by org.dicom4j.io.DicomReader
Direct Known Subclasses:
CommandSetReader, DicomFileReader

public class DicomReader
extends Object

Class to read a DataSet from a stream or bytes

Since:
0.0.0
Author:
Laurent Lecomte

Constructor Summary
DicomReader(byte[] aBytes)
          Creates a new DicomReader
DicomReader(InputStream aInputStream)
          Creates a new DicomReader
 
Method Summary
 void close()
           
 DicomDictionary getDictionary()
           
 ValueRepresentationFactory getVrFactory()
           
 void read(DataSet dataSet, TransferSyntax transferSyntax)
           Read all data from the stream
 void read(DataSet dataSet, TransferSyntax aTransferSyntax, DicomTag aDataElementTag)
           Read all data from the stream until the specified tag is encountered.
 void setDictionary(DicomDictionary dictionary)
          to set the DicomDictionary to used when reading a file.
 InputStream setInputStream(InputStream stream)
           
 void setVrFactory(ValueRepresentationFactory vrFactory)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DicomReader

public DicomReader(byte[] aBytes)
Creates a new DicomReader

Parameters:
aBytes - the bytes to read from

DicomReader

public DicomReader(InputStream aInputStream)
Creates a new DicomReader

Parameters:
aInputStream - the stream to read from
Method Detail

close

public void close()

setInputStream

public InputStream setInputStream(InputStream stream)

read

public void read(DataSet dataSet,
                 TransferSyntax transferSyntax)
          throws IOException,
                 DicomException,
                 Exception

Read all data from the stream

Throws:
IOException
DicomException
Exception

read

public void read(DataSet dataSet,
                 TransferSyntax aTransferSyntax,
                 DicomTag aDataElementTag)
          throws IOException,
                 DicomException,
                 Exception

Read all data from the stream until the specified tag is encountered.

Parameters:
i - the stream to read from
aDataElementTag - the DataElementTag at which to stop
Throws:
IOException
DicomException
Exception

getDictionary

public DicomDictionary getDictionary()
Returns:
Since:
0.0.6

setDictionary

public void setDictionary(DicomDictionary dictionary)
to set the DicomDictionary to used when reading a file. Null can be provided is no dictionary should be used

Parameters:
dictionary -
Since:
0.0.6

getVrFactory

public ValueRepresentationFactory getVrFactory()

setVrFactory

public void setVrFactory(ValueRepresentationFactory vrFactory)


Copyright © 2009 dicom4j. All Rights Reserved.