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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…