Home | History | Annotate | Download | only in bytes

Lines Matching refs:Reader

13 // A Reader implements the io.Reader, io.ReaderAt, io.WriterTo, io.Seeker,
16 // Unlike a Buffer, a Reader is read-only and supports seeking.
17 type Reader struct {
25 func (r *Reader) Len() int {
36 func (r *Reader) Size() int64 { return int64(len(r.s)) }
38 func (r *Reader) Read(b []byte) (n int, err error) {
48 func (r *Reader) ReadAt(b []byte, off int64) (n int, err error) {
51 return 0, errors.New("bytes.Reader.ReadAt: negative offset")
63 func (r *Reader) ReadByte() (byte, error) {
73 func (r *Reader) UnreadByte() error {
76 return errors.New("bytes.Reader.UnreadByte: at beginning of slice")
82 func (r *Reader) ReadRune() (ch rune, size int, err error) {
97 func (r *Reader) UnreadRune() error {
99 return errors.New("bytes.Reader.UnreadRune: previous operation was not ReadRune")
107 func (r *Reader) Seek(offset int64, whence int) (int64, error) {
118 return 0, errors.New("bytes.Reader.Seek: invalid whence")
121 return 0, errors.New("bytes.Reader.Seek: negative position")
128 func (r *Reader) WriteTo(w io.Writer) (n int64, err error) {
136 panic("bytes.Reader.WriteTo: invalid Write count")
146 // Reset resets the Reader to be reading from b.
147 func (r *Reader) Reset(b []byte) { *r = Reader{b, 0, -1} }
149 // NewReader returns a new Reader reading from b.
150 func NewReader(b []byte) *Reader { return &Reader{b, 0, -1} }