Package org.jmrtd.lds
Class CBEFFDataGroup<R extends BiometricDataBlock>
- java.lang.Object
-
- org.jmrtd.lds.AbstractTaggedLDSFile
-
- org.jmrtd.lds.DataGroup
-
- org.jmrtd.lds.CBEFFDataGroup<R>
-
- Type Parameters:
R
- the type of the elements
- All Implemented Interfaces:
Serializable
,LDSElement
,LDSFile
public abstract class CBEFFDataGroup<R extends BiometricDataBlock> extends DataGroup
Datagroup containing a list of biometric information templates (BITs). TheDG2File
,DG3File
, andDG4File
datagroups are based on this type.- Version:
- $Revision: 1781 $
- Author:
- The JMRTD team ([email protected])
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static Logger
LOGGER
-
Fields inherited from interface org.jmrtd.lds.LDSFile
EF_COM_TAG, EF_DG1_TAG, EF_DG10_TAG, EF_DG11_TAG, EF_DG12_TAG, EF_DG13_TAG, EF_DG14_TAG, EF_DG15_TAG, EF_DG16_TAG, EF_DG2_TAG, EF_DG3_TAG, EF_DG4_TAG, EF_DG5_TAG, EF_DG6_TAG, EF_DG7_TAG, EF_DG8_TAG, EF_DG9_TAG, EF_SOD_TAG
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CBEFFDataGroup(int dataGroupTag, InputStream inputStream)
Constructs an instance.protected
CBEFFDataGroup(int dataGroupTag, List<R> subRecords)
Creates a CBEFF data group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(R record)
Adds a record to this data group.void
addAll(List<R> records)
Adds all records in a list to this data group.boolean
equals(Object other)
byte[]
getEncoded()
Returns the contents of this file as byte array, includes the ICAO tag and length.List<R>
getSubRecords()
Returns the records in this data group.int
hashCode()
void
remove(int index)
Removes the record at the given index.String
toString()
Returns a textual representation of this data group.protected void
writeOptionalRandomData(OutputStream outputStream)
Concrete implementations of EAC protected CBEFF DataGroups should call this method at the end of theirAbstractTaggedLDSFile.writeContent(OutputStream)
method to add some random data if the record contains zero biometric templates.-
Methods inherited from class org.jmrtd.lds.AbstractTaggedLDSFile
getLength, getTag, readContent, readObject, writeContent, writeObject
-
-
-
-
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 tagsubRecords
- 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 useinputStream
- 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.
-
getSubRecords
public List<R> getSubRecords()
Returns the records in this data group.- Returns:
- the records in this data group
-
writeOptionalRandomData
protected void writeOptionalRandomData(OutputStream outputStream) throws IOException
Concrete implementations of EAC protected CBEFF DataGroups should call this method at the end of theirAbstractTaggedLDSFile.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 interfaceLDSElement
- Returns:
- a byte array containing the file
-
-