美文网首页
AIDL 序列化byte[]时处理

AIDL 序列化byte[]时处理

作者: 梁佳凝 | 来源:发表于2020-02-21 16:44 被阅读0次

参考:https://blog.csdn.net/chf1142152101/article/details/73480635

还需要注意,数组是否为null

读取时:

int len = source.readInt();

if(len >0) {

this.tidBytes =new byte[len];

source.readByteArray(this.tidBytes);

}

else{

this.tidBytes =null;

}

写入时:

if(this.tidBytes !=null) {

dest.writeInt(this.tidBytes.length);

dest.writeByteArray(this.tidBytes);

}

else{

dest.writeInt(0);

}

相关文章

网友评论

      本文标题:AIDL 序列化byte[]时处理

      本文链接:https://www.haomeiwen.com/subject/qlacqhtx.html