62,615
社区成员
发帖
与我相关
我的任务
分享
那就使用map吧
Map<String, Integer> map = new LinkedHashMap<String, Integer>();
把数组数据保存到map中
map.put("TimeRefMs", data[index++]);
map.put("OffsetIncl", data[index++]);
map.put("MobOffset", data[index++]);
...
取数据的时候
int TimeRefMs = map.get("TimeRefMs");
...
或者把数组数据用一个类封装保存
class Data {
int TimeRefMs;
int OffsetIncl;
int MobOffset;
...
public Data(int[] data) {
index = 0;
TimeRefMs = data[index++];
...
}
}