Thanks for downloading Dynamsoft Barcode Reader Package!
Your download will start shortly. If your download does not begin, click here to retry.
FileFetcher
The FileFetcher
class is a utility class that partitions a multi-page image file into multiple independent ImageData
objects. It inherits the ImageSourceAdapter
class so that you can set it as the input of CaptureVisionRouter
with the API setInput
.
Definition
Namespace: com.dynamsoft.utility
Assembly: DynamsoftUtility.aar
class FileFetcher
Methods
Method | Description |
---|---|
setFile(filePath) |
Sets the file with a file path. |
setFile(fileBytes) |
Sets the file with file bytes. |
setFile(imageData) |
Sets the file with a ImageData object. |
setFile(bitmap) |
Sets the file with a Bitmap . |
hasNextImageToFetch |
Whether there is a next image to fetch. |
getImage |
Get the image data of the image. |
setPages |
Set the pages to read. |
setFile(filePath)
Sets the file with a file path.
void setFile(String filePath) throws UtilityException
Parameters
[in] filePath
: The file path.
Exception
Error Code | Value | Description |
---|---|---|
EC_FILE_NOT_FOUND | -10005 | The file is not found. |
EC_FILE_TYPE_NOT_SUPPORTED | -10006 | The file type is not supported. |
setFile(fileBytes)
Sets the file with file bytes.
void setFile(byte[] fileBytes) throws UtilityException
Parameters
[in] fileBytes
: The file bytes.
Exception
Error Code | Value | Description |
---|---|---|
EC_NULL_POINTER | -10002 | The fileBytes you input is null. |
setFile(imageData)
Sets the file with a ImageData
object.
void setFile(ImageData imageData) throws UtilityException
Parameters
[in] buffer
: The image data.
Exception
Error Code | Value | Description |
---|---|---|
EC_NULL_POINTER | -10002 | The ImageData object is null. |
setFile(bitmap)
Sets the file with an android.graphics.Bitmap
.
void setFile(Bitmap bitmap) throws UtilityException
Parameters
[in] image
: An android.graphics.Bitmap
.
Exception
Error Code | Value | Description |
---|---|---|
EC_NULL_POINTER | -10002 | The image data of the Bitmap is null. |
hasNextImageToFetch
Whether there is a next image to fetch.
boolean hasNextImageToFetch()
Return Value
A boolean value that indicates whether there is a next image to fetch.
getImage
Get the image data of the image.
ImageData getImage()
Return Value
A ImageData
as the image.
setPages
Set the pages to read.
void setPages(int[] pages) throws UtilityException;
Parameters
pages
: An array that contains all the pages to read.
Exception
Error Code | Value | Description |
---|---|---|
EC_FILE_NOT_FOUND | -10005 | File not found. |
EC_FILE_TYPE_NOT_SUPPORTED | -10006 | The file type is not supported. |
EC_IMAGE_READ_FAILED | -10012 | Failed to read the image. |
Inherited Methods
The following methods are inherited from the ImageSourceAdapter
class:
Method | Description |
---|---|
hasNextImageToFetch |
Determines whether there are more images left to fetch. |
setMaxImageCount |
Set the maximum capability of the Video Buffer. |
getMaxImageCount |
Get the property defines the maximum capability of the Video Buffer. |
setBufferOverflowProtectionMode |
Sets a mode that determines the action to take when there is a new incoming image and the buffer is full. You can either block the Video Buffer or push out the oldest image and append a new one. |
getBufferOverflowProtectionMode |
Get the buffer overflow protection mode. |
getImageCount |
Get the current image count in the Video Buffer. |
isBufferEmpty |
Check whether the Video Buffer is empty. |
setColourChannelUsageType |
Set the usage type of a color channel in an image. |
getColourChannelUsageType |
Get the usage type of a color channel in an image. |
startFetching |
Start fetching images from the source to the Video Buffer of ImageSourceAdapter. |
stopFetching |
Stop fetching images from the source to the Video Buffer of ImageSourceAdapter. |
getImage |
Get an image from the Video Buffer. |
setNextImageToReturn(imageId) |
Specify the next image that is returned by method getImage. |
setNextImageToReturn(imageId,keepInBuffer) |
Specify the next image that is returned by method getImage. |
hasImage |
Check the availability of the specified image. |
addImageToBuffer |
Adds an image to the buffer of the adapter. |
clearBuffer |
Clears the image buffer. |
setErrorListener |
Clears the image buffer. |