io: refactoring for using WriteVarBytes instead of WriteLE

goal is to be consistent with C# implementation.
For writing []byte WriteBytes used and for byte - WriteVarByte.
This commit is contained in:
Vsevolod Brekelov 2019-11-22 13:34:06 +03:00
parent d02673c112
commit 03ff2976ed
20 changed files with 33 additions and 34 deletions

View file

@ -177,8 +177,7 @@ func dumpDB(ctx *cli.Context) error {
buf := io.NewBufBinWriter()
b.EncodeBinary(buf.BinWriter)
bytes := buf.Bytes()
writer.WriteLE(uint32(len(bytes)))
writer.WriteLE(bytes)
writer.WriteVarBytes(bytes)
if writer.Err != nil {
return cli.NewExitError(err, 1)
}