Class DefaultFileIOProcessor
-
- All Implemented Interfaces:
-
io.scanbot.sdk.persistence.fileio.BaseFileIOProcessor
,io.scanbot.sdk.persistence.fileio.FileIOProcessor
,io.scanbot.sdk.persistence.fileio.ImageFileIOProcessor
public final class DefaultFileIOProcessor implements FileIOProcessor
Represents default file IO operations with default system file IO tools
-
-
Field Summary
Fields Modifier and Type Field Description private final Boolean
useEncryption
private final Context
context
-
Constructor Summary
Constructors Constructor Description DefaultFileIOProcessor(Context context)
-
Method Summary
Modifier and Type Method Description Boolean
getUseEncryption()
final Context
getContext()
Unit
writeImage(Bitmap bitmap, Bitmap.CompressFormat compressFormat, Integer quality, File destination)
Write Bitmap to the destination File Bitmap
readImage(File source, BitmapFactory.Options options)
Read Bitmap image from the source File Bitmap
readImage(Uri sourceUri, BitmapFactory.Options options)
Read Bitmap image from the source file Uri ByteArray
read(File source)
Read ByteArray data from the source File Unit
write(ByteArray byteArray, File destination)
Write ByteArray data to the destination File Unit
copyRaw(File source, File destination)
Creates a raw copy of the source file to the destination file OutputStream
openFileOutputStream(File destinationFile)
Returns OutputStream for the destination file InputStream
openFileInputStream(File sourceFile)
Returns OutputStream for the source file -
-
Constructor Detail
-
DefaultFileIOProcessor
DefaultFileIOProcessor(Context context)
-
-
Method Detail
-
getUseEncryption
Boolean getUseEncryption()
-
getContext
final Context getContext()
-
writeImage
Unit writeImage(Bitmap bitmap, Bitmap.CompressFormat compressFormat, Integer quality, File destination)
- Parameters:
bitmap
- the source Bitmap imagecompressFormat
- Bitmap.CompressFormat The format of the compressed imagequality
- Int Hint to the compressor, 0-100.destination
- the destination file
-
readImage
Bitmap readImage(File source, BitmapFactory.Options options)
- Parameters:
source
- the source file object, or null if it could not be decoded.
-
readImage
Bitmap readImage(Uri sourceUri, BitmapFactory.Options options)
-
read
ByteArray read(File source)
- Parameters:
source
- the source file object, or null if it could not be decoded.
-
write
Unit write(ByteArray byteArray, File destination)
- Parameters:
byteArray
- data to writedestination
- the destination file
-
copyRaw
Unit copyRaw(File source, File destination)
Creates a raw copy of the source file to the destination file
-
openFileOutputStream
OutputStream openFileOutputStream(File destinationFile)
Returns OutputStream for the destination file
-
openFileInputStream
InputStream openFileInputStream(File sourceFile)
Returns OutputStream for the source file
-
-
-
-