1 Star 0 Fork 4.9K

Cain / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
BufferStream.md 6.90 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

BufferStream

Overview

Related Modules:

Format

Description:

Defines the function for reading stream data.

Since:

1.0

Version:

1.0

Summary

Data Fields

Variable Name

Description

ReadData )(void *handle, uint8_t *data, int32_t size, int32_t timeOutMs, DataFlags *flags)

int32_t(* 

Reads data from streams, save the data to the buffer pointed by data with the specified size, and returns the size of the read data and type.

GetReadableSize )(const void *handle)

int32_t(* 

Obtains the size of data that can be read.

handle

void * 

Details

Field Documentation

GetReadableSize

int32_t(* BufferStream::GetReadableSize) (const void *[handle](BufferStream.md#ae2019a77aba73fa96d5a716155c7fb7f))

Description:

Obtains the size of data that can be read.

Before reading data, you should call this function to check whether there is data to read.

Parameters:

Name

Description

handle Indicates the pointer to the context handle.

Returns:

Returns the size of the read data.

handle

void* BufferStream::handle

Description:

Context handle

ReadData

int32_t(* BufferStream::ReadData) (void *[handle](BufferStream.md#ae2019a77aba73fa96d5a716155c7fb7f), uint8_t *data, int32_t size, int32_t timeOutMs, [DataFlags](Format.md#gacff079fdf8427c743f9197ea5be33a7f) *flags)

Description:

Reads data from streams, save the data to the buffer pointed by data with the specified size, and returns the size of the read data and type.

Parameters:

Name

Description

handle Indicates the pointer to the context handle.
data Indicates the pointer to the buffer to store the read data. The memory is allocated by the caller.
size Indicates the size of the available buffer memory.
timeOutMs Indicates read operation wait time. The value 0 means no wait time.
flags Indicates the pointer to the type of the read data, see DataFlags.

Returns:

Returns the size of the read data.

1
https://gitee.com/cain_qin/docs.git
git@gitee.com:cain_qin/docs.git
cain_qin
docs
docs
master

搜索帮助