Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
XXQAQ authored Feb 10, 2021
1 parent 5b3e115 commit 7995300
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@
还有一点需要说明:数组既可以是基础数据类型,也可以是对象。
长度依赖某个字段:
```
class StateArray{
class ExampleArray{
@Order(order = 1)
short head;
@Order(order = 2)
byte cmd;
@Order(order = 10)
byte stateCount;
@Length(lengthByField = "stateCount")
byte count;
@Length(lengthByField = "count")
@Order(order = 11)
State[] states;
KeyValue[] keyValues;
@Order(order = 100)
byte sum;
}
class State {
class KeyValue {
@Order(order = 1)
byte key;
@Order(order = 2)
Expand All @@ -108,19 +108,19 @@
```
定长:
```
class StateArray{
class ExampleArray{
@Order(order = 1)
short head;
@Order(order = 2)
byte cmd;
@Length(length = 3)
@Order(order = 11)
State[] states;
KeyValue[] keyValues;
@Order(order = 100)
byte sum;
}
class State {
class KeyValue {
@Order(order = 1)
byte key;
@Order(order = 2)
Expand Down

0 comments on commit 7995300

Please sign in to comment.