Interface EmbeddedFile
-
- All Implemented Interfaces:
public interface EmbeddedFile
Represents file embedded in FileAnnotation or com.pspdfkit.document.PdfDocument.
-
-
Method Summary
Modifier and Type Method Description abstract String
getId()
Returns identifier of this embedded file. abstract String
getFileName()
Returns name of the file. abstract long
getFileSize()
Returns file size. abstract String
getFileDescription()
Returns file description. abstract Date
getModificationDate()
Returns file modification date. abstract Completable
writeToStreamAsync(@NonNull() OutputStream outputStream)
Writes the complete contents of this file to the specified output stream, asynchronously. abstract void
writeToStream(@NonNull() OutputStream outputStream)
Writes the complete contents of this file to the specified output stream. abstract Array<byte>
getFileData()
Reads whole file and returns its data. abstract FileAnnotation
getAnnotation()
Returns FileAnnotation to which this file is attached to. -
-
Method Detail
-
getId
@NonNull() abstract String getId()
Returns identifier of this embedded file.
- Returns:
Identifier of this embedded file that is unique across the document.
-
getFileName
@NonNull() abstract String getFileName()
Returns name of the file.
-
getFileSize
abstract long getFileSize()
Returns file size.
- Returns:
File size in bytes or FILE_SIZE_UNKNOWN if size could not be determined.
-
getFileDescription
@Nullable() abstract String getFileDescription()
Returns file description.
- Returns:
File description or
null
if not set.
-
getModificationDate
@Nullable() abstract Date getModificationDate()
Returns file modification date.
- Returns:
File modification date or
null
if not set.
-
writeToStreamAsync
@NonNull() abstract Completable writeToStreamAsync(@NonNull() OutputStream outputStream)
Writes the complete contents of this file to the specified output stream, asynchronously.
- Parameters:
outputStream
- Output stream to which to write file's data.- Returns:
Completable that completes once the writing finishes.
-
writeToStream
abstract void writeToStream(@NonNull() OutputStream outputStream)
Writes the complete contents of this file to the specified output stream.
- Parameters:
outputStream
- Output stream to which to write file's data.
-
getFileData
@NonNull() abstract Array<byte> getFileData()
Reads whole file and returns its data. This could take a while and should be executed on background thread.
- Returns:
Byte array of file's data.
-
getAnnotation
@Nullable() abstract FileAnnotation getAnnotation()
Returns FileAnnotation to which this file is attached to.
- Returns:
Owning annotation or
null
if not available.
-
-
-
-