diff options
Diffstat (limited to 'libgo/go/strings/reader.go')
-rw-r--r-- | libgo/go/strings/reader.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libgo/go/strings/reader.go b/libgo/go/strings/reader.go index 82df974398c..7a872fbcb08 100644 --- a/libgo/go/strings/reader.go +++ b/libgo/go/strings/reader.go @@ -28,6 +28,12 @@ func (r *Reader) Len() int { return int(int64(len(r.s)) - r.i) } +// Size returns the original length of the underlying string. +// Size is the number of bytes available for reading via ReadAt. +// The returned value is always the same and is not affected by calls +// to any other method. +func (r *Reader) Size() int64 { return int64(len(r.s)) } + func (r *Reader) Read(b []byte) (n int, err error) { if len(b) == 0 { return 0, nil |