Package com.pspdfkit.document.providers
Interface WritingStrategy
-
- All Implemented Interfaces:
public interface WritingStrategy
WritingStrategy is used by the OutputStreamAdapter to determine how writing to the WritableDataProvider is handled. Writing works in three steps:
prepare is called before any writing takes place.
write is called until all data has been written.
finishWriting is called once all data has been written.
It is the WritingStrategys responsibility to call OutputStreamAdapter.writeToDataProvider and OutputStreamAdapter.finishWritingToDataProvider at the appropriate times.
-
-
Method Summary
Modifier and Type Method Description abstract Unit
prepare(OutputStreamAdapter adapter)
Called by the OutputStreamAdapter before the first byte is written. abstract Unit
write(ByteArray data)
Called by the OutputStreamAdapter with the data that should be written. abstract Unit
finishWriting()
Called by the OutputStreamAdapter once the last byte was written. -
-
Method Detail
-
prepare
abstract Unit prepare(OutputStreamAdapter adapter)
Called by the OutputStreamAdapter before the first byte is written.
- Parameters:
adapter
- The OutputStreamAdapter using this WritingStrategy.
-
write
abstract Unit write(ByteArray data)
Called by the OutputStreamAdapter with the data that should be written.
- Parameters:
data
- The data that should be written.
-
finishWriting
abstract Unit finishWriting()
Called by the OutputStreamAdapter once the last byte was written. You should clear your reference to the OutputStreamAdapter at this time.
-
-
-
-