Skip to content

Commit

Permalink
fix Reader.Seek example. add overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o authored Sep 6, 2023
1 parent ca19f95 commit b957d07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ using Byter
int age2 = r.Read<int>(); age: 1024;

// NEED READ LAST INT
r.Seek(r.Position - sizeof(int) /* int size is 4 */);
r.Seek(r.Position - sizeof(int) + sizeof(char) /* int size is 4 + char size is 2. The 2 bytes is overhead of protocol */);
int age3 = r.Read<int>(); age: 1024 (because i return 4bytes before old current value)
```

Expand Down

0 comments on commit b957d07

Please sign in to comment.