@Override
public void readValue(DicomInputStream dis, Attributes attrs)
throws IOException {
checkIsThis(dis);
if (excludeBulkData) {
skipFully(length);
} else if (length == 0) {
attrs.setNull(tag, vr);
} else if (vr == VR.SQ) {
readSequence(length, attrs, tag);
} else if (length == -1) {
readFragments(attrs, tag, vr);
} else if (length == BulkData.MAGIC_LEN
&& super.in instanceof ObjectInputStream) {
attrs.setValue(tag, vr, BulkData.deserializeFrom(
(ObjectInputStream) super.in));
} else if (includeBulkDataURI) {
attrs.setValue(tag, vr, bulkDataCreator.createBulkData(this));
} else {
byte[] b = readValue();
if (!TagUtils.isGroupLength(tag)) {
if (bigEndian != attrs.bigEndian())
vr.toggleEndian(b, false);
attrs.setBytes(tag, vr, b);
} else if (tag == Tag.FileMetaInformationGroupLength)
setFileMetaInformationGroupLength(b);
}
}