public void writeItemTo(DicomOutputStream out) throws IOException { DicomEncodingOptions encOpts = out.getEncodingOptions(); int len = getEncodedItemLength(encOpts, out.isExplicitVR()); out.writeHeader(Tag.Item, null, len); writeTo(out); if (len == -1) out.writeHeader(Tag.ItemDelimitationItem, null, 0); }
public void writeGroupTo(DicomOutputStream out, int groupLengthTag) throws IOException { if (isEmpty()) throw new IllegalStateException("No attributes"); checkInGroup(0, groupLengthTag); checkInGroup(size-1, groupLengthTag); SpecificCharacterSet cs = getSpecificCharacterSet(); out.writeGroupLength(groupLengthTag, calcLength(out.getEncodingOptions(), out.isExplicitVR(), cs, null)); writeTo(out, cs, 0, size, 0); }