Export Parameter : Buffer

本文介绍了如何计算用于导出操作的缓冲区大小。通过指定缓冲区大小,可以确定每次导出操作中处理的行数。文章提供了一个计算公式,并通过一个具体的例子展示了计算过程。

Specifies the size, in bytes, of the buffer used to fetch rows. As a result, this parameter determines the maximum number of rows in an array fetched by Export.
Use the following formula to calculate the buffer size:
buffer_size = rows_in_array * maximum_row_size
If you specify zero, the Export utility fetches only one row at a time.
Tables with columns of typeLONG,LOB,BFILE,REF,ROWID,LOGICALROWID, or
DATE are fetched one row at a time.

Example: Calculating Buffer Size
This section shows an example of how to calculate buffer size.
The following table is created:
CREATE TABLE sample (name varchar(30), weight number);
The maximum size of thename column is 30, plus 2 bytes for the indicator. The
maximum size of theweight column is 22 (the size of the internal representation for Oracle numbers), plus 2 bytes for the indicator.
Therefore, the maximum row size is 56 (30+2+22+2).
To perform array operations for 100 rows, a buffer size of 5600 should be specified.

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-968359/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10599713/viewspace-968359/

/* Used like the ioctl function to control the jitter buffer parameters */ EXPORT int jitter_buffer_ctl(JitterBuffer *jitter, int request, void *ptr) { int count; spx_uint32_t i; spx_int32_t buffer_size; switch(request) { case JITTER_BUFFER_SET_MARGIN: jitter->buffer_margin = *(spx_int32_t*)ptr; break; case JITTER_BUFFER_GET_MARGIN: *(spx_int32_t*)ptr = jitter->buffer_margin; break; case JITTER_BUFFER_GET_AVALIABLE_COUNT: count = 0; for (i=0;i<jitter->buffer_size;i++) { if (jitter->packets[i].data && LE32(jitter->pointer_timestamp, jitter->packets[i].timestamp)) { count++; } } *(spx_int32_t*)ptr = count; break; case JITTER_BUFFER_SET_DESTROY_CALLBACK: jitter->destroy = (void (*) (void *))ptr; break; case JITTER_BUFFER_GET_DESTROY_CALLBACK: *(void (**) (void *))ptr = jitter->destroy; break; case JITTER_BUFFER_SET_DELAY_STEP: jitter->delay_step = *(spx_int32_t*)ptr; break; case JITTER_BUFFER_GET_DELAY_STEP: *(spx_int32_t*)ptr = jitter->delay_step; break; case JITTER_BUFFER_SET_CONCEALMENT_SIZE: jitter->concealment_size = *(spx_int32_t*)ptr; break; case JITTER_BUFFER_GET_CONCEALMENT_SIZE: *(spx_int32_t*)ptr = jitter->concealment_size; break; case JITTER_BUFFER_SET_MAX_LATE_RATE: jitter->max_late_rate = *(spx_int32_t*)ptr; jitter->window_size = 100*TOP_DELAY/jitter->max_late_rate; jitter->subwindow_size = jitter->window_size/MAX_BUFFERS; break; case JITTER_BUFFER_GET_MAX_LATE_RATE: *(spx_int32_t*)ptr = jitter->max_late_rate; break; case JITTER_BUFFER_SET_LATE_COST: jitter->latency_tradeoff = *(spx_int32_t*)ptr; break; case JITTER_BUFFER_GET_LATE_COST: *(spx_int32_t*)ptr = jitter->latency_tradeoff; break; case JITTER_BUFFER_SET_LIMIT: buffer_size = *(spx_int32_t*)ptr; jitter->buffer_size = (buffer_size > 1 && buffer_size <= SPEEX_JITTER_MAX_BUFFER_SIZE) ? buffer_size : SPEEX_JITTER_MAX_BUFFER_SIZE; jitter_buffer_reset(jitter); break; default: speex_warning_int("Unknown jitter_buffer_ctl request: ", request); return -1; } return 0; } 以及/** Set minimum amount of extra buffering required (margin) */ #define JITTER_BUFFER_SET_MARGIN 0 /** Get minimum amount of extra buffering required (margin) */ #define JITTER_BUFFER_GET_MARGIN 1 /* JITTER_BUFFER_SET_AVAILABLE_COUNT wouldn't make sense */ /** Get the amount of available packets currently buffered */ #define JITTER_BUFFER_GET_AVAILABLE_COUNT 3 /** Included because of an early misspelling (will remove in next release) */ #define JITTER_BUFFER_GET_AVALIABLE_COUNT 3 /** Assign a function to destroy unused packet. When setting that, the jitter buffer no longer copies packet data. */ #define JITTER_BUFFER_SET_DESTROY_CALLBACK 4 /** */ #define JITTER_BUFFER_GET_DESTROY_CALLBACK 5 /** Tell the jitter buffer to only adjust the delay in multiples of the step parameter provided */ #define JITTER_BUFFER_SET_DELAY_STEP 6 /** */ #define JITTER_BUFFER_GET_DELAY_STEP 7 /** Tell the jitter buffer to only do concealment in multiples of the size parameter provided */ #define JITTER_BUFFER_SET_CONCEALMENT_SIZE 8 #define JITTER_BUFFER_GET_CONCEALMENT_SIZE 9 /** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss should be half of that or less. */ #define JITTER_BUFFER_SET_MAX_LATE_RATE 10 #define JITTER_BUFFER_GET_MAX_LATE_RATE 11 /** Equivalent cost of one percent late packet in timestamp units */ #define JITTER_BUFFER_SET_LATE_COST 12 #define JITTER_BUFFER_GET_LATE_COST 13 #define JITTER_BUFFER_SET_LIMIT 101 解释每个宏定义的含义
09-16
IP_GLOBAL Ip_err ipssh_buffer_put_ecc_key(Ipcom_buffer* buf, ecc_key* eccKey) { Ip_s32 len_buf; int len_pos; char* len_ptr; printf("ipssh_buffer_put_ecc_key :: begin!\n"); if (!buf) { IPCOM_LOG0(ERR, "ipssh_buffer_put_ecc_key :: input buf Error!"); return IPCOM_ERR_FAILED; } if (IP_NULL == eccKey) { IPCOM_LOG0(ERR, "ipssh_buffer_put_ecc_key :: input ecc Error!"); return IPCOM_ERR_FAILED; } len_pos = ipcom_buffer_len(buf); len_buf = ipcom_buffer_len(buf); if(ipcom_buffer_put_int(buf, 0)) { IPCOM_LOG0(ERR, "ipssh_buffer_put_ecc_key :: ipssh_buffer_put_bn() failed %d", __LINE__); return IPCOM_ERR_FAILED; } if(ipssh_buffer_put_sshstr(buf, IPSSH_ECC_STR)) { IPCOM_LOG0(ERR, "ipssh_buffer_put_sshstr ::'ecdsa-sha2-nistp256' failed."); return IPCOM_ERR_FAILED; } char* curve_name = "nistp256"; if(ipssh_buffer_put_sshstr(buf, curve_name)) { IPCOM_LOG0(ERR, "ipssh_buffer_put_sshstr ::'nistp256' failed."); return IPCOM_ERR_FAILED; } unsigned char point_buf[65]; word32 point_len; if(ecc_export_x963(eccKey, point_buf, &point_len) != 0) { IPCOM_LOG0(ERR, "ipssh_buffer_put_ecc_key :: ecc_export_x963 failed."); return IPCOM_ERR_FAILED; } printf("ecc public key exported: len = %d, [0] = %02X, [1] = %02X, [2] = %02X.\n", point_len, point_buf[0], point_buf[1], point_buf[2]); if(point_len != 65) { IPCOM_LOG0(ERR, "ipssh_buffer_put_ecc_key :: unexcepted point length %d, excepted 65.", point_len); return IPCOM_ERR_FAILED; } if(ipssh_buffer_put_ssh_mpint(buf, point_buf, point_len)) { IPCOM_LOG0(ERR, "ipssh_buffer_put_ecc_key :: unexcepted point length %d, excepted 65.", point_len); printf("ipssh_buffer_put_ecc_key :: unexcepted point length %d, excepted 65.", point_len); return IPCOM_ERR_FAILED; } printf("ECC key written to buf, total len = %d \n", ipcom_buffer_len(buf)); len_ptr = ipcom_buffer_ptr2pos(buf, len_pos); len_buf = ipcom_buffer_len(buf)-len_buf-4; printf("ECC key written to buf, total len = %d \n", len_buf); IP_SET_32ON8(len_ptr, (ip_htonl(len_buf))); return IPCOM_SUCCESS; } 详细解释以上代码,查找有没有潜在错误
10-22
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值