// NewReader returns a Reader that reads from the specified Rope.
508711
func NewReader(rope Rope) *Reader {
	// Put the leftmost path on the stack.
	var reader Reader
	if rope.node != nil {
		reader.stack = make([]*concat, 0, rope.node.depth())
		reader.pushSubtree(rope.node)
	}
	return &reader
}
619970
func (s *Stdin) NewReader(id string) (io.ReadCloser, error) {
	return os.Stdin, nil
}
1316707
func NewReader(r io.Reader) *Reader {
	io.CopyN(ioutil.Discard, r, 8) // Discard global header

	return &Reader{r: r}
}
528676
func NewReadLogger(prefix string, r io.Reader) io.Reader {
	return &readLogger{prefix, r}
}
246715
func NewReader(b ByteSlice) (*Reader, error) {
	return newReader(b, ioutil.NopCloser(nil))
}
1341232
func NewReader(e *message.Entity) *Reader {
	mr := e.MultipartReader()
	if mr == nil {
		// Artificially create a multipart entity
		// With this header, no error will be returned by message.NewMultipart
		var h message.Header
		h.Set("Content-Type", "multipart/mixed")
		me, _ := message.NewMultipart(h, []*message.Entity{e})
		mr = me.MultipartReader()
	}

	l := list.New()
	l.PushBack(mr)

	return &Reader{Header{e.Header}, e, l}
}
893219
func NewReader(metrics []telegraf.Metric, serializer *Serializer) io.Reader {
	return &reader{
		metrics:    metrics,
		serializer: serializer,
		offset:     0,
		buf:        bytes.NewBuffer(make([]byte, 0, serializer.maxLineBytes)),
	}
}
39461
func (rw *GCS) NewReader(id string) (io.ReadCloser, error) {
	ctx := context.Background()
	obj := rw.bucket.Object(rw.Prefixed.Name(id))
	return obj.NewReader(ctx)
}
976930
func NewReader(opts ...reader.Option) reader.Reader {
	options := reader.NewOptions(opts...)
	return &jsonReader{
		json: json.NewEncoder(),
		opts: options,
	}
}
925321
func NewFromReader(r io.Reader) (*Json, error) {
	j := new(Json)
	dec := json.NewDecoder(r)
	dec.UseNumber()
	err := dec.Decode(&j.data)
	return j, err
}
77784
func NewReader(readCloser io.ReadCloser, args *ReaderArgs) *Reader {
	d := jstream.NewDecoder(readCloser, 0).ObjectAsKVS()
	return &Reader{
		args:       args,
		decoder:    d,
		valueCh:    d.Stream(),
		readCloser: readCloser,
	}
}
759701
func NewReader(fp sophie.FsPath) (*Reader, error) {
	reader, err := fp.Fs.Open(fp.Path)
	if err != nil {
		return nil, err
	}
	return &Reader{
		reader: countedReadCloser{ReadCloser: reader},
	}, nil
}
1305070
func NewReader(r io.Reader, uncompressedSize int) (io.ReadCloser, error) {
	if uncompressedSize > windowSize {
		return nil, errors.New("uncompressed size is limited to 32KB")
	}
	f := &decompressor{
		lru:          [3]uint16{1, 1, 1},
		uncompressed: uncompressedSize,
		b:            make([]byte, 4096),
		r:            r,
	}
	return f, nil
}
550441
func NewReader(in io.Reader) (*Reader, error) {
	r := new(Reader)
	r.r.source = in
	r.r.seeker, _ = in.(io.Seeker)
	if err := r.init(); err != nil {
		return nil, err
	}
	return r, nil
}
1171293
func NewReader(readCloser io.ReadCloser, args *ReaderArgs) (*Reader, error) {
	if args == nil || args.IsEmpty() {
		panic(fmt.Errorf("empty args passed %v", args))
	}

	csvReader := csv.NewReader(&recordReader{
		reader:          readCloser,
		recordDelimiter: []byte(args.RecordDelimiter),
		oneByte:         []byte{0},
	})
	csvReader.Comma = []rune(args.FieldDelimiter)[0]
	csvReader.Comment = []rune(args.CommentCharacter)[0]
	csvReader.FieldsPerRecord = -1
	// If LazyQuotes is true, a quote may appear in an unquoted field and a
	// non-doubled quote may appear in a quoted field.
	csvReader.LazyQuotes = true
	// If TrimLeadingSpace is true, leading white space in a field is ignored.
	// This is done even if the field delimiter, Comma, is white space.
	csvReader.TrimLeadingSpace = true

	r := &Reader{
		args:       args,
		readCloser: readCloser,
		csvReader:  csvReader,
	}

	if args.FileHeaderInfo == none {
		return r, nil
	}

	record, err := csvReader.Read()
	if err != nil {
		if err != io.EOF {
			return nil, errCSVParsingError(err)
		}

		return nil, err
	}

	if args.FileHeaderInfo == use {
		r.columnNames = record
	}

	return r, nil
}
1000164
func NewReader(buf []byte, simple bool) (reader *Reader) {
	reader = new(Reader)
	reader.buf = buf
	reader.Simple = simple
	return
}
982231
func NewParserReader(logFile io.Reader, parser StringParser) *Reader {
	return &Reader{
		file:   logFile,
		parser: parser,
	}
}