Class DG3File

    • Constructor Detail

      • DG3File

        public DG3File​(List<FingerInfo> fingerInfos)
        Creates a new file with the specified records.
        Parameters:
        fingerInfos - records
      • DG3File

        public DG3File​(List<FingerInfo> fingerInfos,
                       boolean shouldAddRandomDataIfEmpty)
        Creates a new file with the specified records.
        Parameters:
        fingerInfos - records
        shouldAddRandomDataIfEmpty - whether to add random data when there are no records to encode
      • DG3File

        public DG3File​(InputStream inputStream)
                throws IOException
        Creates a new file based on an input stream.
        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 outputStream)
                             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:
        outputStream - the output stream to write to
        Throws:
        IOException - on error writing to output stream
      • getFingerInfos

        public List<FingerInfo> getFingerInfos()
        Gets the finger infos embedded in this file.
        Returns:
        finger infos
      • addFingerInfo

        public void addFingerInfo​(FingerInfo fingerInfo)
        Adds a finger info to this file.
        Parameters:
        fingerInfo - the finger info to add
      • removeFingerInfo

        public void removeFingerInfo​(int index)
        Removes a finger info from this file.
        Parameters:
        index - the index of the finger info to remove
      • 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