vm: add bufBinWriter to emit functions in order to catch errors
This commit is contained in:
parent
821c9b2851
commit
d02673c112
6 changed files with 93 additions and 57 deletions
|
@ -93,6 +93,11 @@ func (w *BinWriter) WriteVarUint(val uint64) {
|
|||
|
||||
}
|
||||
|
||||
// WriteVarBytes writes a variable byte into the underlying io.Writer without prefix.
|
||||
func (w *BinWriter) WriteVarBytes(b []byte) {
|
||||
w.WriteLE(b)
|
||||
}
|
||||
|
||||
// WriteBytes writes a variable length byte array into the underlying io.Writer.
|
||||
func (w *BinWriter) WriteBytes(b []byte) {
|
||||
w.WriteVarUint(uint64(len(b)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue