Class ByteRange

java.lang.Object
eu.europa.esig.dss.pades.validation.ByteRange
All Implemented Interfaces:
Serializable

public class ByteRange extends Object implements Serializable
This class represents a ByteRange of a PDF Revision
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    ByteRange(int[] byteRangeArray)
    This constructor represents a ByteRange extracted from a Signature Dictionary of a signed/timestamped revision
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    Returns the last byte number of the first part of the revision
    int
    Returns the first byte number of the first part of the revision
    int
    Returns a total revision length
    int
    Returns the last byte number of the second part of the revision
    int
    Returns the first byte number of the second part of the revision
    int
     
    boolean
    Returns if the /ByteRange is valid
    void
    setValid(boolean valid)
    Sets whether /ByteRange has passed the verification against the PDF document
    Transforms the ByteRange to a list of BigIntegers
     
    void
    Checks a validity of the ByteRange according to PDF specifications.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ByteRange

      public ByteRange(int[] byteRangeArray)
      This constructor represents a ByteRange extracted from a Signature Dictionary of a signed/timestamped revision
      Parameters:
      byteRangeArray - byte range of a signature/timestamp
  • Method Details

    • getLength

      public int getLength()
      Returns a total revision length
      Returns:
      length
    • getFirstPartStart

      public int getFirstPartStart()
      Returns the first byte number of the first part of the revision
      Returns:
      first byte
    • getFirstPartEnd

      public int getFirstPartEnd()
      Returns the last byte number of the first part of the revision
      Returns:
      first part end byte
    • getSecondPartStart

      public int getSecondPartStart()
      Returns the first byte number of the second part of the revision
      Returns:
      second part start byte
    • getSecondPartEnd

      public int getSecondPartEnd()
      Returns the last byte number of the second part of the revision
      Returns:
      second part end byte
    • toBigIntegerList

      public List<BigInteger> toBigIntegerList()
      Transforms the ByteRange to a list of BigIntegers
      Returns:
      a list of BigIntegers
    • isValid

      public boolean isValid()
      Returns if the /ByteRange is valid
      Returns:
      TRUE if the /ByteRange is valid, FALSE otherwise
    • setValid

      public void setValid(boolean valid)
      Sets whether /ByteRange has passed the verification against the PDF document
      Parameters:
      valid - if the /ByteRange is valid
    • validate

      public void validate()
      Checks a validity of the ByteRange according to PDF specifications. This method verifies the array of integers representing the ByteRange itself without taking into account the PDF document, nor the /Contents octets. NOTE : this method throws a IllegalInputException if an error is encountered and does not update the state of the object. Please use setValid(valid) method to define the validity of the ByteRange.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object