throw new IllegalArgumentException(
"privRecUID must be null for type != PRIVATE");
}
if (keys == null)
keys = recordKeys.get(type);
Attributes rec = new Attributes(keys.length + (fileIDs != null ? 9 : 5));
rec.setInt(Tag.OffsetOfTheNextDirectoryRecord, VR.UL, 0);
rec.setInt(Tag.RecordInUseFlag, VR.US, IN_USE);
rec.setInt(Tag.OffsetOfReferencedLowerLevelDirectoryEntity, VR.UL, 0);
rec.setString(Tag.DirectoryRecordType, VR.CS, type.code());
if (privRecUID != null)
rec.setString(Tag.PrivateRecordUID, VR.UI, privRecUID);
if (fileIDs != null) {
rec.setString(Tag.ReferencedFileID, VR.CS, fileIDs);
rec.setString(Tag.ReferencedSOPClassUIDInFile, VR.UI,
fmi.getString(Tag.MediaStorageSOPClassUID, null));
rec.setString(Tag.ReferencedSOPInstanceUIDInFile, VR.UI,
fmi.getString(Tag.MediaStorageSOPInstanceUID, null));
rec.setString(Tag.ReferencedTransferSyntaxUIDInFile, VR.UI,
fmi.getString(Tag.TransferSyntaxUID, null));
}
rec.addSelected(dataset, keys, 0, keys.length);
Sequence contentSeq = dataset.getSequence(Tag.ContentSequence);
if (contentSeq != null)
copyConceptMod(contentSeq, rec);
return rec;
}