Foxit PDF RDK

Public Member Functions | List of all members
StreamCallback Class Reference

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

Inheritance diagram for StreamCallback:

## 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...
| ReadBlock (offset, size)
| Read a data block from stream. More...
| Release ()
| Destroy the current instance. More...
| Retain ()
| Create a shared instance. More...
| WriteBlock (buffer, offset, size)
| Write a block data into stream. More...
Public Member Functions inherited from NativeObjectWrapper
| constructor (r)
| GetPointerAsNumber ()

## Detailed Description

File stream interface, reading & writing.

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## Member Function Documentation

## ◆ Flush()

StreamCallback.Flush | ( |  | ) |

Flush internal buffer.

Returns
  true means success, and false means failure.

## ◆ GetPosition()

StreamCallback.GetPosition | ( |  | ) |

Get the current reading position in stream.

Returns
  Current reading position.

## ◆ GetSize()

StreamCallback.GetSize | ( |  | ) |

Get the current stream size, in bytes.

Returns
  Current stream size, in bytes.

## ◆ IsEOF()

StreamCallback.IsEOF | ( |  | ) |

Determine whether reach the end of stream.

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

## ◆ ReadBlock()

StreamCallback.ReadBlock | ( | offset | ,
|  | size |
| ) |  |

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
  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.

## ◆ Release()

StreamCallback.Release | ( |  | ) |

Destroy the current instance.

Returns
  None.

## ◆ Retain()

StreamCallback.Retain | ( |  | ) |

Create a shared instance.

Returns
  File stream interface.

## ◆ WriteBlock()

StreamCallback.WriteBlock | ( | buffer | ,
|  | offset | ,
|  | size |
| ) |  |

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.