Package org.jmrtd.lds.icao
Class DG3File
- java.lang.Object
-
- org.jmrtd.lds.AbstractTaggedLDSFile
-
- org.jmrtd.lds.DataGroup
-
- org.jmrtd.lds.CBEFFDataGroup<FingerInfo>
-
- org.jmrtd.lds.icao.DG3File
-
- All Implemented Interfaces:
Serializable
,LDSElement
,LDSFile
public class DG3File extends CBEFFDataGroup<FingerInfo>
File structure for the EF_DG3 file. Partially specified in ISO/IEC FCD 19794-4 aka Annex F.- Version:
- $Revision: 1751 $
- Author:
- The JMRTD team ([email protected])
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jmrtd.lds.CBEFFDataGroup
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 Constructor Description DG3File(InputStream inputStream)
Creates a new file based on an input stream.DG3File(List<FingerInfo> fingerInfos)
Creates a new file with the specified records.DG3File(List<FingerInfo> fingerInfos, boolean shouldAddRandomDataIfEmpty)
Creates a new file with the specified records.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFingerInfo(FingerInfo fingerInfo)
Adds a finger info to this file.boolean
equals(Object obj)
byte[]
getEncoded()
Returns the contents of this file as byte array, includes the ICAO tag and length.List<FingerInfo>
getFingerInfos()
Gets the finger infos embedded in this file.int
hashCode()
protected void
readContent(InputStream inputStream)
Reads the contents of the data group from an input stream.void
removeFingerInfo(int index)
Removes a finger info from this file.String
toString()
Gets a textual representation of this file.protected void
writeContent(OutputStream outputStream)
Writes the contents of the data group to an output stream.-
Methods inherited from class org.jmrtd.lds.AbstractTaggedLDSFile
getLength, getTag, readObject, writeObject
-
Methods inherited from class org.jmrtd.lds.CBEFFDataGroup
add, addAll, getSubRecords, remove, writeOptionalRandomData
-
-
-
-
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
- recordsshouldAddRandomDataIfEmpty
- 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 classAbstractTaggedLDSFile
- 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 classAbstractTaggedLDSFile
- Parameters:
outputStream
- the output stream to write to- Throws:
IOException
- on error writing to output stream
-
toString
public String toString()
Gets a textual representation of this file.- Overrides:
toString
in classCBEFFDataGroup<FingerInfo>
- Returns:
- a textual representation of this file
-
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
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classCBEFFDataGroup<FingerInfo>
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classCBEFFDataGroup<FingerInfo>
-
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
-
-