Package org.jmrtd.lds

Class CBEFFDataGroup<R extends BiometricDataBlock>

    • Field Detail

      • LOGGER

        protected static final Logger LOGGER
    • Constructor Detail

      • CBEFFDataGroup

        protected CBEFFDataGroup​(int dataGroupTag,
                                 List<R> subRecords)
        Creates a CBEFF data group.
        Parameters:
        dataGroupTag - the data group tag
        subRecords - the sub-records contained in this data group
      • CBEFFDataGroup

        protected CBEFFDataGroup​(int dataGroupTag,
                                 InputStream inputStream)
                          throws IOException
        Constructs an instance.
        Parameters:
        dataGroupTag - the datagroup tag to use
        inputStream - an input stream
        Throws:
        IOException - on error
    • Method Detail

      • add

        public void add​(R record)
        Adds a record to this data group.
        Parameters:
        record - the record to add
      • addAll

        public void addAll​(List<R> records)
        Adds all records in a list to this data group.
        Parameters:
        records - the records to add
      • remove

        public void remove​(int index)
        Removes the record at the given index.
        Parameters:
        index - the index of the record to remove
      • toString

        public String toString()
        Returns a textual representation of this data group.
        Overrides:
        toString in class DataGroup
        Returns:
        a textual representation of this data group
      • getSubRecords

        public List<R> getSubRecords()
        Returns the records in this data group.
        Returns:
        the records in this data group
      • hashCode

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

        protected void writeOptionalRandomData​(OutputStream outputStream)
                                        throws IOException
        Concrete implementations of EAC protected CBEFF DataGroups should call this method at the end of their AbstractTaggedLDSFile.writeContent(OutputStream) method to add some random data if the record contains zero biometric templates. See supplement to ICAO Doc 9303 R7-p1_v2_sIII_0057.
        Parameters:
        outputStream - the outputstream
        Throws:
        IOException - on I/O errors
      • 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