Foxit PDF SDK

Public Member Functions | List of all members
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 | ( |  | ) |
| inline virtual

Flush internal buffer.

Returns
  true means success, and false means failure.

## ◆ GetPosition()

long foxit.common.fxcrt.StreamCallback.GetPosition | ( |  | ) |
| inline virtual

Get the current reading position in stream.

Returns
  Current reading position.

## ◆ GetSize()

long foxit.common.fxcrt.StreamCallback.GetSize | ( |  | ) |
| inline virtual

Get the current stream size, in bytes.

Returns
  Current stream size, in bytes.

## ◆ IsEOF()

bool foxit.common.fxcrt.StreamCallback.IsEOF | ( |  | ) |
| inline virtual

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
| ) |  |
| inline virtual

Read a data block from stream.

Parameters

  [in,out] | buffer | Pointer to a buffer receiving data.
  [in] | offset | Byte offset from beginning of the file, the position to read data.
  [in] | size | Number 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
| ) |  |
| inline virtual

Read data block from stream.

Parameters

  [in,out] | buffer | Buffer to store data.
  [in] | size | Total 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 | ( |  | ) |
| inline virtual

Destroy the current instance.

Returns
  None.

## ◆ Retain()

StreamCallback foxit.common.fxcrt.StreamCallback.Retain | ( |  | ) |
| inline virtual

Create a shared instance.

Returns
  File stream interface.

## ◆ WriteBlock()

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

Write a block data into stream.

Parameters

  [in] | buffer | Pointer to the data block.
  [in] | offset | Byte offset from beginning of the file, the position to write data.
  [in] | size | The length in bytes of the buffer.

Returns
  true means success, and false means failure.