Class COMFile

    • Constructor Detail

      • COMFile

        public COMFile​(String versionLDS,
                       String updateLevelLDS,
                       String majorVersionUnicode,
                       String minorVersionUnicode,
                       String releaseLevelUnicode,
                       int[] tagList)
        Constructs a new COM file.
        Parameters:
        versionLDS - a numerical string of length 2
        updateLevelLDS - a numerical string of length 2
        majorVersionUnicode - a numerical string of length 2
        minorVersionUnicode - a numerical string of length 2
        releaseLevelUnicode - a numerical string of length 2
        tagList - a list of ICAO data group tags
        Throws:
        IllegalArgumentException - if the input is not well-formed
      • COMFile

        public COMFile​(String ldsVer,
                       String unicodeVer,
                       int[] tagList)
        Constructs a new COM file.
        Parameters:
        ldsVer - a "x.y" version number
        unicodeVer - a "x.y.z" version number
        tagList - list of tags
      • COMFile

        public COMFile​(InputStream in)
                throws IOException
        Constructs a new EF_COM file based on the encoded value in in.
        Parameters:
        in - should contain a TLV object with appropriate tag and contents
        Throws:
        IOException - if the input could not be decoded
    • Method Detail

      • readContent

        protected void readContent​(InputStream in)
                            throws IOException
        Description copied from class: AbstractTaggedLDSFile
        Reads the contents of the data group from an input stream. Client code implementing this method should only read the contents from the input stream, not the tag or length of the data group.
        Specified by:
        readContent in class AbstractTaggedLDSFile
        Parameters:
        in - the input stream to read from
        Throws:
        IOException - on error reading from input stream
      • getLDSVersion

        public String getLDSVersion()
        Returns the LDS version as a dot seperated string containing version and update level.
        Returns:
        a string of the form "a.b"
      • getUnicodeVersion

        public String getUnicodeVersion()
        Returns the unicode version as a dot seperated string containing major version, minor version, and release level.
        Returns:
        a string of the form "aa.bb.cc"
      • getTagList

        public int[] getTagList()
        Returns the ICAO datagroup tags as a list of bytes.
        Returns:
        a list of bytes
      • insertTag

        public void insertTag​(Integer tag)
        Inserts a tag in a proper place if not already present.
        Parameters:
        tag - the tag to insert
      • writeContent

        protected void writeContent​(OutputStream out)
                             throws IOException
        Description copied from class: AbstractTaggedLDSFile
        Writes the contents of the data group to an output stream. Client code implementing this method should only write the contents to the output stream, not the tag or length of the data group.
        Specified by:
        writeContent in class AbstractTaggedLDSFile
        Parameters:
        out - the output stream to write to
        Throws:
        IOException - on error writing to output stream
      • toString

        public String toString()
        Returns a textual representation of this file.
        Overrides:
        toString in class AbstractTaggedLDSFile
        Returns:
        a textual representation of this file
      • equals

        public boolean equals​(Object other)
        Whether other is equal to this file.
        Overrides:
        equals in class Object
        Returns:
        a boolean
      • hashCode

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

        public byte[] getEncoded()
        Returns the contents of this file as byte array, includes the ICAO tag and length.
        Specified by:
        getEncoded in interface LDSElement
        Returns:
        a byte array containing the file