Commit graph

9 commits

Author SHA1 Message Date
Roman Khimov
e41d434a49 *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
Roman Khimov
54d888ba70 io: add type-specific read/write methods
This seriously improves the serialization/deserialization performance for
several reasons:
 * no time spent in `binary` reflection
 * no memory allocations being made on every read/write
 * uses fast ReadBytes everywhere it's appropriate

It also makes Fixed8 Serializable just for convenience.
2019-12-12 20:19:50 +03:00
Evgenii Stratonikov
2be18f91df util: implement io.Serializable for Uint256 2019-11-14 14:20:38 +03:00
Vsevolod Brekelov
8ee421db14 fix spelling and godoc comments 2019-10-22 17:56:03 +03:00
Roman Khimov
5bca4d2313 io: expand panic tests to reach 100% coverage 2019-09-17 13:23:24 +03:00
Roman Khimov
d1a4e43c48 io: redo Serializable to return errors in BinReader/BinWriter
Further simplifies error handling.
2019-09-17 13:21:52 +03:00
Roman Khimov
e299a44983 io: drop Size() method from Serializable and associated
It's no longer needed after the io.GetVarSize() improvement. It's duplicating
a lot of EncodeBinary() logic also.
2019-09-17 13:21:45 +03:00
Roman Khimov
56c72b5c67 io: redo GetVarSize for Serializable things
Use writes to a fake io.Writer that counts the bytes. Allows us to kill Size()
methods as useless and duplicating lots of functionality.
2019-09-16 23:39:54 +03:00
Roman Khimov
0da9fe6946 io: move size calculator there
It's mostly used for Serializable and in other cases where one needs to
estimate binary-encoded size of the stucture. This also simplifies future
removal of the Size() from Serializable.
2019-09-16 23:39:54 +03:00
Renamed from pkg/util/size_test.go (Browse further)