Package com.pixelmed.dicom

# Class MediaImporter.OurReadTerminationStrategy

java.lang.Object
com.pixelmed.dicom.MediaImporter.OurReadTerminationStrategy

All Implemented Interfaces:
  `AttributeList.ReadTerminationStrategy`

Enclosing class:
  MediaImporter

protected static class MediaImporter.OurReadTerminationStrategy extends Object implements AttributeList.ReadTerminationStrategy

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`OurReadTerminationStrategy()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`terminate(AttributeList attributeList, AttributeTag tag, long byteOffset)`
Define the criteria for prematurely terminating the reading of a DICOM file.

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### OurReadTerminationStrategy

protected OurReadTerminationStrategy()

## Method Details

### terminate

public boolean terminate(AttributeList attributeList, AttributeTag tag, long byteOffset)
Description copied from interface: `AttributeList.ReadTerminationStrategy`

Define the criteria for prematurely terminating the reading of a DICOM file.

Permits more complex strategies than simply stopping at the stopAtTag.

Is tested during the read of the top-level dataset ONLY, i.e., not tested within sequences (which means that is strategy is based on byteOffset, very long sequences might still be read).

Tested just AFTER a tag has been read, but before the rest of the attribute for that tag, hence will leave the stream positioned just after that tag if reading is stopped (just like the stopAtTag behavior).

Specified by:
  `terminate` in interface `AttributeList.ReadTerminationStrategy`
Parameters:
  `attributeList` - the list as read so far
  `tag` - the tag that has just been read
  `byteOffset` - the number of bytes read so far
Returns:
  true if reading should be stopped