参考: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);
}
网友评论