io: allow to restrict string size
This commit is contained in:
parent
376c22adee
commit
7fb40e104a
1 changed files with 2 additions and 2 deletions
|
@ -193,7 +193,7 @@ func (r *BinReader) ReadBytes(buf []byte) {
|
|||
}
|
||||
|
||||
// ReadString calls ReadVarBytes and casts the results as a string.
|
||||
func (r *BinReader) ReadString() string {
|
||||
b := r.ReadVarBytes()
|
||||
func (r *BinReader) ReadString(maxSize ...int) string {
|
||||
b := r.ReadVarBytes(maxSize...)
|
||||
return string(b)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue