Foxit PDF SDK
foxit.common.fxcrt.StreamCallback Class Reference

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

Inherits SystemIDisposable.

Public Member Functions

virtual bool Flush ()
 Flush internal buffer.
More...
 
virtual long GetPosition ()
 Get the current reading position in stream.
More...
 
virtual long GetSize ()
 Get the current stream size, in bytes.
More...
 
virtual bool IsEOF ()
 Determine whether reach the end of stream.
More...
 
virtual bool ReadBlock (global::System.IntPtr buffer, long offset, uint size)
 Read a data block from stream.
More...
 
virtual uint ReadBlock (global::System.IntPtr buffer, uint size)
 Read data block from stream.
More...
 
virtual void Release ()
 Destroy the current instance.
More...
 
virtual StreamCallback Retain ()
 Create a shared instance.
More...
 
virtual bool WriteBlock (global::System.IntPtr buffer, long offset, uint size)
 Write a block data into stream.
More...
 

Detailed Description

File stream interface, reading & writing.

Member Function Documentation

◆ Flush()

bool foxit.common.fxcrt.StreamCallback.Flush ( )
inlinevirtual

Flush internal buffer.

Returns
true means success, and false means failure.

◆ GetPosition()

long foxit.common.fxcrt.StreamCallback.GetPosition ( )
inlinevirtual

Get the current reading position in stream.

Returns
Current reading position.

◆ GetSize()

long foxit.common.fxcrt.StreamCallback.GetSize ( )
inlinevirtual

Get the current stream size, in bytes.

Returns
Current stream size, in bytes.

◆ IsEOF()

bool foxit.common.fxcrt.StreamCallback.IsEOF ( )
inlinevirtual

Determine whether reach the end of stream.

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

◆ ReadBlock() [1/2]

bool foxit.common.fxcrt.StreamCallback.ReadBlock ( global::System.IntPtr  buffer,
long  offset,
uint  size 
)
inlinevirtual

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
true means success, and false means failure.

◆ ReadBlock() [2/2]

uint foxit.common.fxcrt.StreamCallback.ReadBlock ( global::System.IntPtr  buffer,
uint  size 
)
inlinevirtual

Read data block from stream.

Parameters
[in,out]bufferBuffer to store data.
[in]sizeTotal size of buffer, in bytes.
Returns
The length of data stored in buffer. If returns 0, means error or no data.

◆ Release()

void foxit.common.fxcrt.StreamCallback.Release ( )
inlinevirtual

Destroy the current instance.

Returns
None.

◆ Retain()

StreamCallback foxit.common.fxcrt.StreamCallback.Retain ( )
inlinevirtual

Create a shared instance.

Returns
File stream interface.

◆ WriteBlock()

bool foxit.common.fxcrt.StreamCallback.WriteBlock ( global::System.IntPtr  buffer,
long  offset,
uint  size 
)
inlinevirtual

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.