Class DG2File

    • Constructor Detail

      • DG2File

        public DG2File​(List<FaceInfo> faceInfos)
        Creates a new file with the specified records.
        Parameters:
        faceInfos - records
      • DG2File

        public DG2File​(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
      • toString

        public String toString()
        Returns a textual representation of this file.
        Overrides:
        toString in class CBEFFDataGroup<FaceInfo>
        Returns:
        a textual representation of this file
      • getFaceInfos

        public List<FaceInfo> getFaceInfos()
        Returns the face infos embedded in this file.
        Returns:
        face infos
      • addFaceInfo

        public void addFaceInfo​(FaceInfo faceInfo)
        Adds a face info to this file.
        Parameters:
        faceInfo - the face info to add
      • removeFaceInfo

        public void removeFaceInfo​(int index)
        Removes a face info from this file.
        Parameters:
        index - the index of the face 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