Package org.jmrtd.lds
Class DisplayedImageInfo
- java.lang.Object
-
- org.jmrtd.lds.AbstractImageInfo
-
- org.jmrtd.lds.DisplayedImageInfo
-
- All Implemented Interfaces:
Serializable
,ImageInfo
,LDSElement
public class DisplayedImageInfo extends AbstractImageInfo
Data structure for storing either a Portrait (as used in DG5) or a Signature or mark (as used in DG7).- Version:
- $Revision: 1766 $
- Author:
- The JMRTD team ([email protected])
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
DISPLAYED_PORTRAIT_TAG
static int
DISPLAYED_SIGNATURE_OR_MARK_TAG
-
Fields inherited from interface org.jmrtd.lds.ImageInfo
JPEG_MIME_TYPE, JPEG2000_MIME_TYPE, TYPE_FINGER, TYPE_IRIS, TYPE_PORTRAIT, TYPE_SIGNATURE_OR_MARK, TYPE_UNKNOWN, WSQ_MIME_TYPE
-
-
Constructor Summary
Constructors Constructor Description DisplayedImageInfo(int type, byte[] imageBytes)
Constructs a displayed image info from the image bytes.DisplayedImageInfo(InputStream in)
Constructs a displayed image info from binary encoding.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
long
getRecordLength()
Returns the record length of the encoded image info.int
hashCode()
protected void
readObject(InputStream inputStream)
Reads the displayed image.protected void
writeObject(OutputStream outputStream)
Writes this object to a stream.-
Methods inherited from class org.jmrtd.lds.AbstractImageInfo
getEncoded, getHeight, getImageInputStream, getImageLength, getMimeType, getType, getWidth, readImage, setHeight, setImageBytes, setMimeType, setType, setWidth, toString, writeImage
-
-
-
-
Field Detail
-
DISPLAYED_PORTRAIT_TAG
public static final int DISPLAYED_PORTRAIT_TAG
- See Also:
- Constant Field Values
-
DISPLAYED_SIGNATURE_OR_MARK_TAG
public static final int DISPLAYED_SIGNATURE_OR_MARK_TAG
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DisplayedImageInfo
public DisplayedImageInfo(int type, byte[] imageBytes)
Constructs a displayed image info from the image bytes.- Parameters:
type
- one ofImageInfo.TYPE_PORTRAIT
orImageInfo.TYPE_SIGNATURE_OR_MARK
imageBytes
- encoded image, for Portrait and Signature or mark use JPEG encoding
-
DisplayedImageInfo
public DisplayedImageInfo(InputStream in) throws IOException
Constructs a displayed image info from binary encoding.- Parameters:
in
- an input stream- Throws:
IOException
- if decoding fails
-
-
Method Detail
-
readObject
protected void readObject(InputStream inputStream) throws IOException
Reads the displayed image. This method should be implemented by concrete subclasses. The 5F2E or 7F2E tag and the length are already read.- Specified by:
readObject
in classAbstractImageInfo
- Parameters:
inputStream
- the input stream positioned so that biometric data block tag and length are already read- Throws:
IOException
- if reading fails
-
writeObject
protected void writeObject(OutputStream outputStream) throws IOException
Description copied from class:AbstractImageInfo
Writes this object to a stream.- Specified by:
writeObject
in classAbstractImageInfo
- Parameters:
outputStream
- the stream to write to- Throws:
IOException
- on error writing to the stream
-
getRecordLength
public long getRecordLength()
Returns the record length of the encoded image info.- Returns:
- the record length of the encoded image info
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractImageInfo
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractImageInfo
-
-