protected void finishStream() throws IOException { dos.finish(); ((ImageOutputStream) output).flush(); dos = null; output = null; writer = null; } }
/** * Write a DICOM dataset to the output stream. * * @param attrs * A DicomObject containing the attributes to write. * @param transferSyntax * A TransferSyntax object representing the transfer syntax of * the file. * @throws IOException */ public void writeDataset(DicomObject attrs, TransferSyntax transferSyntax) throws IOException { setTransferSyntax(transferSyntax); this.ts = transferSyntax; writeElements(attrs.datasetIterator(), includeGroupLength, createItemInfo(attrs)); if (autoFinish) { finish(); } }
/** * Write a DICOM dataset to the output stream. This one is needed to handle * a case where group 2 elements are within sequence items. * * @param attrs * A DicomObject containing the attributes to write. * @param transferSyntax * A TransferSyntax object representing the transfer syntax of * the file. * @throws IOException */ public void writeDicomObject(DicomObject attrs, TransferSyntax transferSyntax) throws IOException { setTransferSyntax(transferSyntax); this.ts = transferSyntax; writeElements(attrs.iterator(), includeGroupLength, createItemInfo(attrs)); if (autoFinish) { finish(); } }