Foxit PDF SDK
FSDK.StreamCallback Class Reference

File stream interface, reading & writing. More...

Public Member Functions

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

Detailed Description

File stream interface, reading & writing.

Member Function Documentation

◆ Flush()

FSDK.StreamCallback.Flush ( )
inline

Flush internal buffer.

Returns
true means success, and false means failure.

◆ GetPosition()

FSDK.StreamCallback.GetPosition ( )
inline

Get the current reading position in stream.

Returns
Current reading position.

◆ GetSize()

FSDK.StreamCallback.GetSize ( )
inline

Get the current stream size, in bytes.

Returns
Current stream size, in bytes.

◆ IsEOF()

FSDK.StreamCallback.IsEOF ( )
inline

Determine whether reach the end of stream.

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

◆ Release()

FSDK.StreamCallback.Release ( )
inline

Destroy the current instance.

Returns
None.

◆ Retain()

FSDK.StreamCallback.Retain ( )
inline

Create a shared instance.

Returns
File stream interface.

◆ WriteBlock()

ReadBlock (offset, size) FSDK.StreamCallback.WriteBlock (   buffer,
  offset,
  size 
)
inline

Read a data block from stream.

Parameters
[in,out]bufferPointer to a buffer receiving data.
[in]offsetByte offset from beginning of the file, the position to read data.
[in]sizeNumber of bytes to be read from stream.
Returns
Returns a tuple, the first element is a boolean value, true means success, and false means failure. The second element is a buffer receiving read data.

Write a block data into stream.

Parameters
[in]bufferPointer to the data block.
[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.