java.lang.Object | |
↳ | com.pspdfkit.document.providers.TempFileWritingStrategy |
A WritingStrategy
that writes to a temporary file and writes to the WritableDataProvider
only when all data was written.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TempFileWritingStrategy(File tempFile)
Creates a new
TempFileWritingStrategy . | |||||||||||
TempFileWritingStrategy(Context context)
Creates a new
TempFileWritingStrategy . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
finishWriting()
Called by the
OutputStreamAdapter once the last byte was written. | ||||||||||
void |
prepare(OutputStreamAdapter adapter)
Called by the
OutputStreamAdapter before the first byte is written. | ||||||||||
void |
write(byte[] data)
Called by the
OutputStreamAdapter with the data that should be written. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Creates a new TempFileWritingStrategy
.
tempFile | The file to write to, this will be deleted once the write operation is done. |
---|
Creates a new TempFileWritingStrategy
.
context | Context to use to obtain the cache directory for creating a temporary file. |
---|
IOException |
---|
Called by the OutputStreamAdapter
once the last byte was written. You should clear
your reference to the OutputStreamAdapter
at this time.
IOException |
---|
Called by the OutputStreamAdapter
before the first byte is written.
adapter | The OutputStreamAdapter using this WritingStrategy .
|
---|
Called by the OutputStreamAdapter
with the data that should be written.
data | The data that should be written. |
---|
IOException |
---|