public abstract class AbstractImageInfo extends Object implements ImageInfo
JPEG_MIME_TYPE, JPEG2000_MIME_TYPE, TYPE_FINGER, TYPE_IRIS, TYPE_PORTRAIT, TYPE_SIGNATURE_OR_MARK, WSQ_MIME_TYPE
Modifier | Constructor and Description |
---|---|
protected |
AbstractImageInfo(int type) |
|
AbstractImageInfo(int type,
int width,
int height,
InputStream inputStream,
long imageLength,
String mimeType)
Constructs an abstract image info.
|
protected |
AbstractImageInfo(int type,
String mimeType) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
byte[] |
getEncoded()
Encodes this image info.
|
int |
getHeight()
Gets the height of the image.
|
InputStream |
getImageInputStream()
Gets the encoded image as an input stream.
|
int |
getImageLength()
Gets the length of the encoded image.
|
String |
getMimeType()
Gets the mime-type of the encoded image.
|
abstract long |
getRecordLength()
Gets the record length.
|
int |
getType()
Content type, one of
ImageInfo.TYPE_PORTRAIT ,
ImageInfo.TYPE_FINGER ,
ImageInfo.TYPE_IRIS ,
ImageInfo.TYPE_SIGNATURE_OR_MARK . |
int |
getWidth()
Gets the width of the image.
|
int |
hashCode() |
protected void |
readImage(InputStream inputStream,
long imageLength)
Clients should call this method after positioning the input stream to the
image bytes.
|
protected abstract void |
readObject(InputStream in) |
protected void |
setHeight(int height) |
protected void |
setImageBytes(byte[] imageBytes) |
protected void |
setMimeType(String mimeType) |
protected void |
setType(int type) |
protected void |
setWidth(int width) |
String |
toString()
Gets a textual representation of this image info.
|
protected void |
writeImage(OutputStream outputStream) |
protected abstract void |
writeObject(OutputStream out) |
protected AbstractImageInfo(int type)
protected AbstractImageInfo(int type, String mimeType)
public AbstractImageInfo(int type, int width, int height, InputStream inputStream, long imageLength, String mimeType) throws IOException
type
- type of image infowidth
- width of imageheight
- height of imageinputStream
- encoded imageimageLength
- length of encoded imagemimeType
- mime-type of encoded imageIOException
- if reading failspublic int getType()
ImageInfo.TYPE_PORTRAIT
,
ImageInfo.TYPE_FINGER
,
ImageInfo.TYPE_IRIS
,
ImageInfo.TYPE_SIGNATURE_OR_MARK
.public String getMimeType()
getMimeType
in interface ImageInfo
public int getWidth()
public int getHeight()
public int getImageLength()
getImageLength
in interface ImageInfo
public String toString()
public byte[] getEncoded()
getEncoded
in interface LDSElement
public abstract long getRecordLength()
getRecordLength
in interface ImageInfo
public InputStream getImageInputStream()
getImageInputStream
in interface ImageInfo
protected void readImage(InputStream inputStream, long imageLength) throws IOException
inputStream
- input streamimageLength
- image lengthIOException
- on error reading the input streamprotected void writeImage(OutputStream outputStream) throws IOException
IOException
protected final void setMimeType(String mimeType)
protected final void setType(int type)
protected final void setWidth(int width)
protected final void setHeight(int height)
protected final void setImageBytes(byte[] imageBytes)
protected abstract void readObject(InputStream in) throws IOException
IOException
protected abstract void writeObject(OutputStream out) throws IOException
IOException
Copyright © 2016. All rights reserved.