public static DicomEncodingOptions encodingOptionsOf(CommandLine cl) throws ParseException { if (cl.hasOption("expl-item-len") && cl.hasOption("undef-item-len") || cl.hasOption("expl-seq-len") && cl.hasOption("undef-seq-len")) throw new ParseException( rb.getString("conflicting-enc-opts")); return new DicomEncodingOptions( cl.hasOption("group-len"), !cl.hasOption("expl-seq-len"), cl.hasOption("undef-seq-len"), !cl.hasOption("expl-item-len"), cl.hasOption("undef-item-len")); }
public static DicomEncodingOptions encodingOptionsOf(CommandLine cl) throws ParseException { if (cl.hasOption("expl-item-len") && cl.hasOption("undef-item-len") || cl.hasOption("expl-seq-len") && cl.hasOption("undef-seq-len")) throw new ParseException( rb.getString("conflicting-enc-opts")); return new DicomEncodingOptions( cl.hasOption("group-len"), !cl.hasOption("expl-seq-len"), cl.hasOption("undef-seq-len"), !cl.hasOption("expl-item-len"), cl.hasOption("undef-item-len")); }
private DicomDirWriter(File file) throws IOException { super(file, "rw"); out = new DicomOutputStream(new RAFOutputStreamAdapter(raf), super.getTransferSyntaxUID()); int seqLen = in.length(); boolean undefSeqLen = seqLen <= 0; setEncodingOptions( new DicomEncodingOptions(false, undefSeqLen, false, undefSeqLen, false)); this.nextRecordPos = this.firstRecordPos = (int) in.getPosition(); if (!isEmpty()) { if (seqLen > 0) this.nextRecordPos += seqLen; else this.nextRecordPos = (int) (raf.length() - 12); } updateDirInfoHeader(); }