Package com.pixelmed.dicom

## Class OtherByteAttributeCompressedSeparateFramesOnDisk

- java.lang.Object
- - com.pixelmed.dicom.Attribute
  - - com.pixelmed.dicom.OtherAttributeOnDisk
    - - com.pixelmed.dicom.OtherByteAttributeCompressedSeparateFramesOnDisk

- All Implemented Interfaces:
    `ByteFrameSource`

      public class OtherByteAttributeCompressedSeparateFramesOnDisk
      extends OtherAttributeOnDisk
      implements ByteFrameSource

  A concrete class specializing `Attribute` for Other Byte (OB) attributes whose compressed frames are not memory resident.

  Though an instance of this class may be created using its constructors, there is also a factory class, `AttributeFactory`.

  See Also:
    `Attribute`, `AttributeFactory`, `AttributeList`, `OtherWordAttributeOnDisk`

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected long[][]` | `frameItemByteOffsets` |
    `protected long[][]` | `frameItemLengths` |
    `protected static AttributeTag` | `itemTag` |
    `protected static AttributeTag` | `sequenceDelimitationItemTag` |

    - ### Fields inherited from class com.pixelmed.dicom.OtherAttributeOnDisk

      `byteOffset, deleteFilesWhenNoLongerNeeded, file`

    - ### Fields inherited from class com.pixelmed.dicom.Attribute

      `valueLength, valueMultiplicity`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `OtherByteAttributeCompressedSeparateFramesOnDisk​(AttributeTag t)` | Construct an (empty) attribute.
    `OtherByteAttributeCompressedSeparateFramesOnDisk​(AttributeTag t, DicomInputStream i, long[][] frameItemByteOffsets, long[][] frameItemLengths)` | Create an attribute from an input stream from which the encapsulated items have already been read.
    `OtherByteAttributeCompressedSeparateFramesOnDisk​(AttributeTag t, java.io.File file, long[][] frameItemByteOffsets, long[][] frameItemLengths, boolean deleteFilesWhenNoLongerNeeded)` | Create an attribute from a file that contains tghe compressed frames.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `byte[]` | `getByteValuesForSelectedFrame​(int frameNumber)` | Get the value of this attribute as a byte array for one selected frame.
    `long[][]` | `getFrameItemLengths()` |
    `int` | `getNumberOfFrames()` | Get the number of frames.
    `long` | `getPaddedVL()` | Get the value length of this attribute, accounting for the need for even-length padding.
    `byte[]` | `getVR()` | Get the value representation of this attribute (OB).
    `void` | `write​(DicomOutputStream o)` | Write the entire attribute (including values) to the output stream.
    `protected void` | `writeItemTag​(DicomOutputStream o, long length)` |
    `protected void` | `writeSequenceDelimitationItemTag​(DicomOutputStream o)` |

    - ### Methods inherited from class com.pixelmed.dicom.OtherAttributeOnDisk

      `deleteFilesWhenNoLongerNeeded, finalize, getByteOffset, getFile, removeValues, setFile, setFile, toString`

    - ### Methods inherited from class com.pixelmed.dicom.Attribute

      `addValue, addValue, addValue, addValue, addValue, addValue, addValue, getByteValues, getByteValues, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDoubleValues, getDoubleValues, getDoubleValues, getElement, getFloatValues, getFloatValues, getFloatValues, getGroup, getIntegerValues, getIntegerValues, getIntegerValues, getLengthOfBaseOfEncodedAttribute, getLengthOfEncodedValue, getLengthOfEntireEncodedAttribute, getLongValues, getLongValues, getLongValues, getOriginalStringValues, getShortValues, getSingleDoubleValueOrDefault, getSingleDoubleValueOrDefault, getSingleDoubleValueOrDefault, getSingleFloatValueOrDefault, getSingleFloatValueOrDefault, getSingleFloatValueOrDefault, getSingleIntegerValueOrDefault, getSingleIntegerValueOrDefault, getSingleIntegerValueOrDefault, getSingleLongValueOrDefault, getSingleLongValueOrDefault, getSingleLongValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrNull, getSingleStringValueOrNull, getSingleStringValueOrNull, getSingleStringValueOrNull, getSingleStringValueOrNull, getSingleStringValueOrNull, getStringValues, getStringValues, getStringValues, getStringValues, getStringValues, getStringValues, getTag, getVL, getVM, getVRAsString, isValid, repairValues, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValues, setValues, setValues, setValues, setValues, setValues, setValues, toString, writeBase`

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

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

- - ### Field Detail

    - #### frameItemByteOffsets

          protected long[][] frameItemByteOffsets

    - #### frameItemLengths

          protected long[][] frameItemLengths

    - #### itemTag

          protected static final AttributeTag itemTag

    - #### sequenceDelimitationItemTag

          protected static final AttributeTag sequenceDelimitationItemTag

  - ### Constructor Detail

    - #### OtherByteAttributeCompressedSeparateFramesOnDisk

          public OtherByteAttributeCompressedSeparateFramesOnDisk​(AttributeTag t)

      Construct an (empty) attribute.

      Parameters:
        `t` - the tag of the attribute

    - #### OtherByteAttributeCompressedSeparateFramesOnDisk

          public OtherByteAttributeCompressedSeparateFramesOnDisk​(AttributeTag t,
                                                                  java.io.File file,
                                                                  long[][] frameItemByteOffsets,
                                                                  long[][] frameItemLengths,
                                                                  boolean deleteFilesWhenNoLongerNeeded)
                                                           throws java.io.IOException,
                                                                  DicomException

      Create an attribute from a file that contains tghe compressed frames.

      Parameters:
        `t` - the tag of the attribute
        `file` - the file
        `frameItemByteOffsets` - the byte offsets in the input stream of the start of the data for each item of each frame
        `frameItemLengths` - the lengths in bytes of each item of each frame, with any trailing padding after EOI marker removed (i.e., may be odd)
        `deleteFilesWhenNoLongerNeeded` - delete file when attribute goes out of scope
      Throws:
        `java.io.IOException`
        `DicomException`

    - #### OtherByteAttributeCompressedSeparateFramesOnDisk

          public OtherByteAttributeCompressedSeparateFramesOnDisk​(AttributeTag t,
                                                                  DicomInputStream i,
                                                                  long[][] frameItemByteOffsets,
                                                                  long[][] frameItemLengths)
                                                           throws java.io.IOException,
                                                                  DicomException

      Create an attribute from an input stream from which the encapsulated items have already been read.

      Parameters:
        `t` - the tag of the attribute
        `i` - the input stream
        `frameItemByteOffsets` - the byte offsets in the input stream of the start of the data for each item of each frame
        `frameItemLengths` - the lengths in bytes of each item of each frame
      Throws:
        `java.io.IOException`
        `DicomException`

  - ### Method Detail

    - #### getPaddedVL

          public long getPaddedVL()

      Description copied from class: `Attribute`

      Get the value length of this attribute, accounting for the need for even-length padding.

      Overrides:
        `getPaddedVL` in class `Attribute`
      Returns:
        the value length (padded to an even length)

    - #### writeItemTag

          protected void writeItemTag​(DicomOutputStream o,
                                      long length)
                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeSequenceDelimitationItemTag

          protected void writeSequenceDelimitationItemTag​(DicomOutputStream o)
                                                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### write

          public void write​(DicomOutputStream o)
                     throws DicomException,
                            java.io.IOException

      Description copied from class: `Attribute`

      Write the entire attribute (including values) to the output stream.

      Specified by:
        `write` in class `Attribute`
      Parameters:
        `o` -
      Throws:
        `java.io.IOException`
        `DicomException`

    - #### getByteValuesForSelectedFrame

          public byte[] getByteValuesForSelectedFrame​(int frameNumber)
                                               throws DicomException

      Get the value of this attribute as a byte array for one selected frame.

      Specified by:
        `getByteValuesForSelectedFrame` in interface `ByteFrameSource`
      Parameters:
        `frameNumber` - from 0
      Returns:
        the values as an array of bytes
      Throws:
        `DicomException` - thrown if values cannot be read

    - #### getFrameItemLengths

          public long[][] getFrameItemLengths()

    - #### getNumberOfFrames

          public int getNumberOfFrames()

      Get the number of frames.

      Returns:
        number of frame

    - #### getVR

          public byte[] getVR()

      Get the value representation of this attribute (OB).

      Overrides:
        `getVR` in class `Attribute`
      Returns:
        'O','B' in ASCII as a two byte array; see `ValueRepresentation`