io: rename ReadBytes() to ReadVarBytes()

This commit is contained in:
Evgenii Stratonikov 2019-12-06 18:37:37 +03:00
parent f01fc1cc29
commit 838050f8b5
14 changed files with 22 additions and 22 deletions

View file

@ -127,17 +127,17 @@ func (r *BinReader) ReadVarUint() uint64 {
return uint64(b)
}
// ReadBytes reads the next set of bytes from the underlying reader.
// ReadVarBytes reads the next set of bytes from the underlying reader.
// ReadVarUInt() is used to determine how large that slice is
func (r *BinReader) ReadBytes() []byte {
func (r *BinReader) ReadVarBytes() []byte {
n := r.ReadVarUint()
b := make([]byte, n)
r.ReadLE(b)
return b
}
// ReadString calls ReadBytes and casts the results as a string.
// ReadString calls ReadVarBytes and casts the results as a string.
func (r *BinReader) ReadString() string {
b := r.ReadBytes()
b := r.ReadVarBytes()
return string(b)
}