Class JpegSegmentData

java.lang.Object
com.drew.imaging.jpeg.JpegSegmentData

@Deprecated(since="2024-11-20") public class JpegSegmentData extends Object
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
Holds a collection of JPEG data segments. This need not necessarily be all segments within the JPEG. For example, it may be convenient to store only the non-image segments when analysing metadata.

Segments are keyed via their JpegSegmentType. Where multiple segments use the same segment type, they will all be stored and available.

Each segment type may contain multiple entries. Conceptually the model is: Map<JpegSegmentType, Collection<byte[]>>. This class provides convenience methods around that structure.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addSegment(byte segmentType, byte[] segmentBytes)
    Deprecated.
    Adds segment bytes to the collection.
    boolean
    containsSegment(byte segmentType)
    Deprecated.
    Determines whether data is present for a given segment type.
    boolean
    Deprecated.
    Determines whether data is present for a given segment type.
    byte[]
    getSegment(byte segmentType)
    Deprecated.
    Gets the first JPEG segment data for the specified type.
    byte[]
    getSegment(byte segmentType, int occurrence)
    Deprecated.
    Gets segment data for a specific occurrence and type.
    byte[]
    Deprecated.
    Gets the first JPEG segment data for the specified type.
    byte[]
    getSegment(JpegSegmentType segmentType, int occurrence)
    Deprecated.
    Gets segment data for a specific occurrence and type.
    int
    getSegmentCount(byte segmentType)
    Deprecated.
    Returns the count of segment data byte arrays stored for a given segment type.
    int
    Deprecated.
    Returns the count of segment data byte arrays stored for a given segment type.
    Iterable<byte[]>
    getSegments(byte segmentType)
    Deprecated.
    Returns all instances of a given JPEG segment.
    Iterable<byte[]>
    Deprecated.
    Returns all instances of a given JPEG segment.
    Deprecated.
    Gets the set of JPEG segment type identifiers.
    void
    removeSegment(byte segmentType)
    Deprecated.
    Removes all segments from the collection having the specified type.
    void
    Deprecated.
    Removes all segments from the collection having the specified type.
    void
    removeSegmentOccurrence(byte segmentType, int occurrence)
    Deprecated.
    Removes a specified instance of a segment's data from the collection.
    void
    removeSegmentOccurrence(JpegSegmentType segmentType, int occurrence)
    Deprecated.
    Removes a specified instance of a segment's data from the collection.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JpegSegmentData

      public JpegSegmentData()
      Deprecated.
  • Method Details

    • addSegment

      public void addSegment(byte segmentType, byte[] segmentBytes)
      Deprecated.
      Adds segment bytes to the collection.
      Parameters:
      segmentType - the type of the segment being added
      segmentBytes - the byte array holding data for the segment being added
    • getSegmentTypes

      public Iterable<JpegSegmentType> getSegmentTypes()
      Deprecated.
      Gets the set of JPEG segment type identifiers.
    • getSegment

      public byte[] getSegment(byte segmentType)
      Deprecated.
      Gets the first JPEG segment data for the specified type.
      Parameters:
      segmentType - the JpegSegmentType for the desired segment
      Returns:
      a byte[] containing segment data or null if no data exists for that segment
    • getSegment

      public byte[] getSegment(JpegSegmentType segmentType)
      Deprecated.
      Gets the first JPEG segment data for the specified type.
      Parameters:
      segmentType - the JpegSegmentType for the desired segment
      Returns:
      a byte[] containing segment data or null if no data exists for that segment
    • getSegment

      public byte[] getSegment(JpegSegmentType segmentType, int occurrence)
      Deprecated.
      Gets segment data for a specific occurrence and type. Use this method when more than one occurrence of segment data for a given type exists.
      Parameters:
      segmentType - identifies the required segment
      occurrence - the zero-based index of the occurrence
      Returns:
      the segment data as a byte[], or null if no segment exists for the type & occurrence
    • getSegment

      public byte[] getSegment(byte segmentType, int occurrence)
      Deprecated.
      Gets segment data for a specific occurrence and type. Use this method when more than one occurrence of segment data for a given type exists.
      Parameters:
      segmentType - identifies the required segment
      occurrence - the zero-based index of the occurrence
      Returns:
      the segment data as a byte[], or null if no segment exists for the type & occurrence
    • getSegments

      public Iterable<byte[]> getSegments(JpegSegmentType segmentType)
      Deprecated.
      Returns all instances of a given JPEG segment. If no instances exist, an empty sequence is returned.
      Parameters:
      segmentType - a number which identifies the type of JPEG segment being queried
      Returns:
      zero or more byte arrays, each holding the data of a JPEG segment
    • getSegments

      public Iterable<byte[]> getSegments(byte segmentType)
      Deprecated.
      Returns all instances of a given JPEG segment. If no instances exist, an empty sequence is returned.
      Parameters:
      segmentType - a number which identifies the type of JPEG segment being queried
      Returns:
      zero or more byte arrays, each holding the data of a JPEG segment
    • getSegmentCount

      public int getSegmentCount(JpegSegmentType segmentType)
      Deprecated.
      Returns the count of segment data byte arrays stored for a given segment type.
      Parameters:
      segmentType - identifies the required segment
      Returns:
      the segment count (zero if no segments exist).
    • getSegmentCount

      public int getSegmentCount(byte segmentType)
      Deprecated.
      Returns the count of segment data byte arrays stored for a given segment type.
      Parameters:
      segmentType - identifies the required segment
      Returns:
      the segment count (zero if no segments exist).
    • removeSegmentOccurrence

      public void removeSegmentOccurrence(JpegSegmentType segmentType, int occurrence)
      Deprecated.
      Removes a specified instance of a segment's data from the collection. Use this method when more than one occurrence of segment data exists for a given type exists.
      Parameters:
      segmentType - identifies the required segment
      occurrence - the zero-based index of the segment occurrence to remove.
    • removeSegmentOccurrence

      public void removeSegmentOccurrence(byte segmentType, int occurrence)
      Deprecated.
      Removes a specified instance of a segment's data from the collection. Use this method when more than one occurrence of segment data exists for a given type exists.
      Parameters:
      segmentType - identifies the required segment
      occurrence - the zero-based index of the segment occurrence to remove.
    • removeSegment

      public void removeSegment(JpegSegmentType segmentType)
      Deprecated.
      Removes all segments from the collection having the specified type.
      Parameters:
      segmentType - identifies the required segment
    • removeSegment

      public void removeSegment(byte segmentType)
      Deprecated.
      Removes all segments from the collection having the specified type.
      Parameters:
      segmentType - identifies the required segment
    • containsSegment

      public boolean containsSegment(JpegSegmentType segmentType)
      Deprecated.
      Determines whether data is present for a given segment type.
      Parameters:
      segmentType - identifies the required segment
      Returns:
      true if data exists, otherwise false
    • containsSegment

      public boolean containsSegment(byte segmentType)
      Deprecated.
      Determines whether data is present for a given segment type.
      Parameters:
      segmentType - identifies the required segment
      Returns:
      true if data exists, otherwise false