“In/out/inout” in a AIDL interface parameter value?

本文详细解释了Android AIDL接口中'in'、'out'和'inout'参数的含义及使用场景,阐述了它们在参数序列化过程中的作用,以及如何优化性能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

In AIDL, the "out" tag specifies an output-only parameter. In other words, it's a parameter that contains no interesting data on input, but will be filled with data during the method.

For example, a method that copies an array of bytes might be specified like this:

void copyArray(in byte[] source, out byte[] dest); 

The "inout" tag indicates that the parameter has meaning on both input and output. For example:

void charsToUpper(inout char[] chars); 

This is important because the contents of every parameter must be marshalled (serialized, transmitted, received, and deserialized). The in/out tags allow the Binder to skip the marshalling step for better performance.

转载:http://stackoverflow.com/questions/4700225/in-out-inout-in-a-aidl-interface-parameter-value

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值