Class DG15File

    • Constructor Detail

      • DG15File

        public DG15File​(PublicKey publicKey)
        Constructs a new file.
        Parameters:
        publicKey - the key to store in this file
      • DG15File

        public DG15File​(InputStream inputStream)
                 throws IOException
        Constructs a new file from binary representation.
        Parameters:
        inputStream - an input stream
        Throws:
        IOException - on error reading from input stream
    • Method Detail

      • readContent

        protected void readContent​(InputStream inputStream)
                            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:
        inputStream - the input stream to read from
        Throws:
        IOException - on error reading from input stream
      • 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
      • getPublicKey

        public PublicKey getPublicKey()
        Gets the public key stored in this file.
        Returns:
        the public key
      • hashCode

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

        public String toString()
        Description copied from class: DataGroup
        Gets a textual representation of this file.
        Overrides:
        toString in class DataGroup
        Returns:
        a textual representation of this file
      • 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