Lines Matching refs:Reader
13 // A Reader implements the io.Reader, io.ReaderAt, io.Seeker, io.WriterTo,
16 type Reader struct {
24 func (r *Reader) Len() int {
35 func (r *Reader) Size() int64 { return int64(len(r.s)) }
37 func (r *Reader) Read(b []byte) (n int, err error) {
47 func (r *Reader) ReadAt(b []byte, off int64) (n int, err error) {
50 return 0, errors.New("strings.Reader.ReadAt: negative offset")
62 func (r *Reader) ReadByte() (byte, error) {
72 func (r *Reader) UnreadByte() error {
75 return errors.New("strings.Reader.UnreadByte: at beginning of string")
81 func (r *Reader) ReadRune() (ch rune, size int, err error) {
96 func (r *Reader) UnreadRune() error {
98 return errors.New("strings.Reader.UnreadRune: previous operation was not ReadRune")
106 func (r *Reader) Seek(offset int64, whence int) (int64, error) {
117 return 0, errors.New("strings.Reader.Seek: invalid whence")
120 return 0, errors.New("strings.Reader.Seek: negative position")
127 func (r *Reader) WriteTo(w io.Writer) (n int64, err error) {
135 panic("strings.Reader.WriteTo: invalid WriteString count")
145 // Reset resets the Reader to be reading from s.
146 func (r *Reader) Reset(s string) { *r = Reader{s, 0, -1} }
148 // NewReader returns a new Reader reading from s.
150 func NewReader(s string) *Reader { return &Reader{s, 0, -1} }