public final void setEncodingOptions(DicomEncodingOptions encOpts) {
        if (encOpts == null)
            throw new NullPointerException();
        this.encOpts = encOpts;
    }
@Test
    public void testWriteDatasetWithUndefEmptyLength() throws IOException {
        DicomOutputStream out = new DicomOutputStream(file);
        out.setEncodingOptions(
                new DicomEncodingOptions(false, true, true, true, true));
        testWriteDataset(out, UID.ExplicitVRLittleEndian);
    }