Foxit PDF Conversion SDK
PDFConversionSDK.StreamCallback Class Referenceabstract

Public Member Functions

abstract Flush ()
 Flush internal buffer. More...
 
abstract GetPosition ()
 Get the current reading position in stream. More...
 
abstract GetSize ()
 Get the current stream size, in bytes. More...
 
abstract IsEOF ()
 Determine whether reach the end of stream. More...
 
abstract ReadBlock (offset, size)
 Read a data block from stream. More...
 
abstract ReadBlock (size)
 Read data block from stream. More...
 
abstract Release ()
 Destroy the current instance. More...
 
abstract Retain ()
 Create a shared instance. More...
 
abstract WriteBlock (str, offset, size)
 Write a block data into stream. More...
 

Detailed Description

This class represents a callback object to do file reading and writing. All the pure virtual functions in this class are used as callback functions and should be implemented by user to do file reading and writing in a customized way.

Member Function Documentation

◆ Flush()

abstract PDFConversionSDK.StreamCallback.Flush ( )
pure virtual

Flush internal buffer.

Returns
true means success, and false means failure.

◆ GetPosition()

abstract PDFConversionSDK.StreamCallback.GetPosition ( )
pure virtual

Get the current reading position in stream.

Returns
Current reading position.

◆ GetSize()

abstract PDFConversionSDK.StreamCallback.GetSize ( )
pure virtual

Get the current stream size, in bytes.

Returns
Current stream size, in bytes.

◆ IsEOF()

abstract PDFConversionSDK.StreamCallback.IsEOF ( )
pure virtual

Determine whether reach the end of stream.

Returns
true means reach the end of stream, and false means not yet.

◆ ReadBlock() [1/2]

abstract PDFConversionSDK.StreamCallback.ReadBlock ( offset  ,
size   
)
pure virtual

Read a data block from stream.

Parameters
[in]offsetByte offset from beginning of the file, the position to read data.
[in]sizeNumber of bytes to be read from stream.
Returns
A string of binary format receiving read data.

◆ ReadBlock() [2/2]

abstract PDFConversionSDK.StreamCallback.ReadBlock ( size  )
pure virtual

Read data block from stream.

Parameters
[in]sizeTotal size of buffer, in bytes.
Returns
A string of binary format receiving read data.

◆ Release()

abstract PDFConversionSDK.StreamCallback.Release ( )
pure virtual

Destroy the current instance.

Returns
None.

◆ Retain()

abstract PDFConversionSDK.StreamCallback.Retain ( )
pure virtual

Create a shared instance.

Returns
The StreamCallback object pointer.

◆ WriteBlock()

abstract PDFConversionSDK.StreamCallback.WriteBlock ( str  ,
offset  ,
size   
)
pure virtual

Write a block data into stream.

Parameters
[in]strA string of binary format.
[in]offsetByte offset from beginning of the file, the position to write data.
[in]sizeThe length in bytes of the buffer.
Returns
true means success, and false means failure.