public Attributes readDataset(int len, int stopTag) throws IOException { handler.startDataset(this); readFileMetaInformation(); Attributes attrs = new Attributes(bigEndian, 64); readAttributes(attrs, len, stopTag); attrs.trimToSize(); handler.endDataset(this); return attrs; }
vr = ElementDictionary.getStandardElementDictionary() .vrOf(tag); handler.readValue(this, attrs); } else skipAttribute(UNEXPECTED_ATTRIBUTE);
includeBulkDataURI = len != 0 && vr != VR.SQ && includeBulkData == IncludeBulkData.URI && isBulkData(attrs); handler.readValue(this, attrs); } else skipAttribute(UNEXPECTED_ATTRIBUTE);
private void readFragments(Attributes attrs, int fragsTag, VR vr) throws IOException { Fragments frags = new Fragments(vr, attrs.bigEndian(), 10); String privateCreator = attrs.getPrivateCreator(fragsTag); for (int i = 0; readItemHeader(); ++i) { addItemPointer(fragsTag, privateCreator, i); handler.readValue(this, frags); removeItemPointer(); } if (frags.isEmpty()) attrs.setNull(fragsTag, vr); else { frags.trimToSize(); attrs.setValue(fragsTag, vr, frags); } }
private void readSequence(int len, Attributes attrs, int sqtag) throws IOException { if (len == 0) { attrs.setNull(sqtag, VR.SQ); return; } Sequence seq = attrs.newSequence(sqtag, 10); String privateCreator = attrs.getPrivateCreator(sqtag); boolean undefLen = len == -1; long endPos = pos + (len & 0xffffffffL); boolean explicitVR0 = explicitVR; boolean bigEndian0 = bigEndian; if (encodedVR == 0x554e // UN && !probeExplicitVR()) { explicitVR = false; bigEndian = false; } for (int i = 0; (undefLen || pos < endPos) && readItemHeader(); ++i) { addItemPointer(sqtag, privateCreator, i); handler.readValue(this, seq); removeItemPointer(); } explicitVR = explicitVR0; bigEndian = bigEndian0; if (seq.isEmpty()) attrs.setNull(sqtag, VR.SQ); else seq.trimToSize(); }