mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-29 03:41:45 +00:00
io: allow to restrict string size
This commit is contained in:
parent
89fb02a7f8
commit
feb6ba2ef7
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