@Test void withBulkDataURI() throws IOException { String baseURL = DicomInputStreamTest.resource("waveform_overlay_pixeldata.dcm").toString(); DicomObject data = DicomObject.newDicomObject(); DicomElement seq = data.newDicomSequence(Tag.WaveformSequence); DicomObject item = DicomObject.newDicomObject(); seq.addItem(item); item.setBulkData(Tag.WaveformData, VR.OW, baseURL + "#offset=32&length=256", null); data.setBulkData(Tag.OverlayData, VR.OW, baseURL + "#offset=300&length=256", null); data.setBulkData(Tag.PixelData, VR.OB, baseURL + "#offset=568", null); data.setNull(Tag.DataSetTrailingPadding, VR.OB); assertArrayEquals(resourceAsBytes("waveform_overlay_pixeldata.dcm"), writeDataset(DicomEncoding.EVR_LE, false, DicomOutputStream.LengthEncoding.EXPLICIT, DicomOutputStream.LengthEncoding.EXPLICIT, data)); }
public void writeDataSet(DicomObject dcmobj) throws IOException { if (encoding == null) throw new IllegalStateException("encoding not initialized"); Objects.requireNonNull(dcmobj); if (includeGroupLength || itemLengthEncoding.calculate || sequenceLengthEncoding.calculate) { ((DicomObjectImpl) dcmobj).calculateItemLength(this); } ((DicomObjectImpl) dcmobj).writeTo(this); if (out instanceof DeflaterOutputStream) { ((DeflaterOutputStream) out).finish(); } }
DicomOutputStream extends OutputStream { public void writeDataSet(DicomObject dcmobj) throws IOException { if (encoding == null) throw new IllegalStateException("encoding not initialized"); Objects.requireNonNull(dcmobj); if (includeGroupLength || itemLengthEncoding.calculate || sequenceLengthEncoding.calculate) { ((DicomObjectImpl) dcmobj).calculateItemLength(this); } ((DicomObjectImpl) dcmobj).writeTo(this); if (out instanceof DeflaterOutputStream) { ((DeflaterOutputStream) out).finish(); } } }
DicomOutputStream extends OutputStream { public void writeDataSet(DicomObject dcmobj) throws IOException { if (encoding == null) throw new IllegalStateException("encoding not initialized"); Objects.requireNonNull(dcmobj); if (includeGroupLength || itemLengthEncoding.calculate || sequenceLengthEncoding.calculate) { ((DicomObjectImpl) dcmobj).calculateItemLength(this); } ((DicomObjectImpl) dcmobj).writeTo(this); if (out instanceof DeflaterOutputStream) { ((DeflaterOutputStream) out).finish(); } } DicomOutputStream(OutputStream out); }
DicomOutputStream extends OutputStream { public void writeDataSet(DicomObject dcmobj) throws IOException { if (encoding == null) throw new IllegalStateException("encoding not initialized"); Objects.requireNonNull(dcmobj); if (includeGroupLength || itemLengthEncoding.calculate || sequenceLengthEncoding.calculate) { ((DicomObjectImpl) dcmobj).calculateItemLength(this); } ((DicomObjectImpl) dcmobj).writeTo(this); if (out instanceof DeflaterOutputStream) { ((DeflaterOutputStream) out).finish(); } } DicomOutputStream(OutputStream out); DicomEncoding getEncoding(); DicomOutputStream withEncoding(DicomEncoding encoding); DicomOutputStream withEncoding(DicomObject fmi); boolean isIncludeGroupLength(); DicomOutputStream withIncludeGroupLength(boolean includeGroupLength); LengthEncoding getItemLengthEncoding(); DicomOutputStream withItemLengthEncoding(LengthEncoding itemLengthEncoding); LengthEncoding getSequenceLengthEncoding(); DicomOutputStream withSequenceLengthEncoding(LengthEncoding sequenceLengthEncoding); @Override void write(int b); @Override void write(byte[] b, int off, int len); @Override void flush(); @Override void close(); void writeHeader(int tag, VR vr, int length); DicomOutputStream writeFileMetaInformation(DicomObject fmi); void writeDataSet(DicomObject dcmobj); void writeCommandSet(DicomObject dcmobj); byte[] swapBuffer(); void writeUTF(String s); }
DicomOutputStream extends OutputStream { public void writeDataSet(DicomObject dcmobj) throws IOException { if (encoding == null) throw new IllegalStateException("encoding not initialized"); Objects.requireNonNull(dcmobj); if (includeGroupLength || itemLengthEncoding.calculate || sequenceLengthEncoding.calculate) { ((DicomObjectImpl) dcmobj).calculateItemLength(this); } ((DicomObjectImpl) dcmobj).writeTo(this); if (out instanceof DeflaterOutputStream) { ((DeflaterOutputStream) out).finish(); } } DicomOutputStream(OutputStream out); DicomEncoding getEncoding(); DicomOutputStream withEncoding(DicomEncoding encoding); DicomOutputStream withEncoding(DicomObject fmi); boolean isIncludeGroupLength(); DicomOutputStream withIncludeGroupLength(boolean includeGroupLength); LengthEncoding getItemLengthEncoding(); DicomOutputStream withItemLengthEncoding(LengthEncoding itemLengthEncoding); LengthEncoding getSequenceLengthEncoding(); DicomOutputStream withSequenceLengthEncoding(LengthEncoding sequenceLengthEncoding); @Override void write(int b); @Override void write(byte[] b, int off, int len); @Override void flush(); @Override void close(); void writeHeader(int tag, VR vr, int length); DicomOutputStream writeFileMetaInformation(DicomObject fmi); void writeDataSet(DicomObject dcmobj); void writeCommandSet(DicomObject dcmobj); byte[] swapBuffer(); void writeUTF(String s);  }