/** * Write an item (DicomObject) to the output stream. * * @param item * The DicomObject containing the specific item to write. * @param transferSyntax * The <code>TransferSyntax</code> of the item. * @throws IOException */ public void writeItem(DicomObject item, TransferSyntax transferSyntax) throws IOException { this.ts = transferSyntax; writeItem(item, createItemInfo(item)); }
private void writeRecord(long offset, DicomObject dcmobj) throws IOException { log.debug("Write record @ {} to file {}", new Long(offset), file); if (rollbackLen == -1) { rollbackLen = offset; filesetInfo.setFileSetConsistencyFlag( FileSetInformation.KNOWN_INCONSISTENCIES); raf.seek(firstRecordPos - 14); raf.writeShort(FileSetInformation.KNOWN_INCONSISTENCIES); } raf.seek(offset); out.setStreamPosition(offset); dcmobj.putInt(Tag.OffsetOfTheNextDirectoryRecord, VR.UL, 0); dcmobj.putInt(Tag.RecordInUseFlag, VR.US, INUSE); dcmobj.putInt(Tag.OffsetOfReferencedLowerLevelDirectoryEntity, VR.UL, 0); out.writeItem(dcmobj, in.getTransferSyntax()); recordSeqLen = (int) (out.getStreamPosition() - firstRecordPos); cache.put((int) dcmobj.getItemOffset(), dcmobj); }
.removeFirst() : null; writeItem(item, childItemInfo);