org.dicom4j.io
Class DicomWriter

java.lang.Object
  extended by org.dicom4j.io.DicomWriter
Direct Known Subclasses:
DicomFileWriter

public class DicomWriter
extends Object

Writer used to insert a DataSet into a stream

Since:
0.0.2
Author:
Laurent Lecomte

Constructor Summary
DicomWriter(OutputStream aStream)
          Creates a new writer
 
Method Summary
 void close()
           
static byte[] getDataSetToBytes(DataSet aDataSet, TransferSyntax aTransferSyntax)
          Convert a DataSet into an array of bytes
 OutputStream getStream()
          return the inner stream
 void write(DataSet aDataSet)
          insert data of the DataSetusing the default DICOM TransferSyntax (Implicit VR Little Endian)
 void write(DataSet aDataSet, TransferSyntax aTransferSyntax)
          insert data of the Dataset using the supplied DICOM TransferSyntax
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DicomWriter

public DicomWriter(OutputStream aStream)
Creates a new writer

Parameters:
aStream - the stream to write
Method Detail

getDataSetToBytes

public static byte[] getDataSetToBytes(DataSet aDataSet,
                                       TransferSyntax aTransferSyntax)
                                throws IOException,
                                       DicomException
Convert a DataSet into an array of bytes

Parameters:
aDataSet - the Dataset
aTransferSyntax - the TransferSyntax to use
Returns:
the Dataset as array of bytes
Throws:
IOException
DicomException

close

public void close()

getStream

public OutputStream getStream()
return the inner stream

Returns:
the stream

write

public void write(DataSet aDataSet)
           throws IOException,
                  DicomException
insert data of the DataSetusing the default DICOM TransferSyntax (Implicit VR Little Endian)

Parameters:
aDataSet - the DataSet to write
Throws:
IOException
DicomException

write

public void write(DataSet aDataSet,
                  TransferSyntax aTransferSyntax)
           throws IOException,
                  DicomException
insert data of the Dataset using the supplied DICOM TransferSyntax

Parameters:
aDataSet - the DataSet to insert
aTransferSyntax - the TransferSyntax to use
Throws:
IOException
DicomException


Copyright © 2009 dicom4j. All Rights Reserved.