// NewReader returns a new S3 Reader
517962
func (s *S3) NewReader(id string) (io.ReadCloser, error) {
	r, _, err := s.bucket.GetReader(s.Prefixed.Name(id), nil)
	return r, err
}
390462
func (d Decoder) NewReader(rd io.Reader) *Reader {
	b := new(Reader)
	b.buf = make([]byte, defaultBufSize)
	b.rd = rd
	b.decode = d
	return b
}
626387
func NewReader(r io.Reader) io.Reader {
	buf := bufio.NewReader(r)
	b, err := buf.Peek(3)
	if err != nil {
		// not enough bytes
		return buf
	}
	if b[0] == bom0 && b[1] == bom1 && b[2] == bom2 {
		discardBytes(buf, 3)
	}
	return buf
}
1154452
func NewReader(ra ReaderAt) io.Reader {
	rd := io.NewSectionReader(ra, 0, ra.Size())
	return rd
}
828107
func NewReader(r io.Reader, maxSize int) *Reader {
	if maxSize <= 0 {
		maxSize = DefaultMaxSize
	}
	qr := &Reader{}
	buf := make([]byte, 8)
	if _, err := io.ReadFull(r, buf); err != nil {
		qr.err = err
		return qr
	} else if bytes.Compare(magic[:], buf[:4]) != 0 {
		qr.err = fmt.Errorf("not a pquads file")
		return qr
	}
	vers := binary.LittleEndian.Uint32(buf[4:])
	if vers != currentVersion {
		qr.err = fmt.Errorf("unsupported pquads version: %d", vers)
		return qr
	}

	qr.pr = pio.NewReader(r, maxSize)
	var h Header
	if err := qr.pr.ReadMsg(&h); err != nil {
		qr.err = err
	}
	qr.opts = Options{
		Full:   h.Full,
		Strict: !h.NotStrict,
	}
	return qr
}
1241205
func NewReader(r io.Reader) *Reader {
	return &Reader{
		br: bufio.NewReader(r),
	}
}
976930
func NewReader(opts ...reader.Option) reader.Reader {
	options := reader.NewOptions(opts...)
	return &jsonReader{
		json: json.NewEncoder(),
		opts: options,
	}
}
285577
func NewReader(r io.Reader, bo binary.ByteOrder) Reader {
	return &reader{
		r:  r,
		bo: bo,
	}
}
479871
func NewReader(r io.ReaderAt, size int64) (*Reader, error) {
	zr := new(Reader)
	if err := zr.init(r, size); err != nil {
		return nil, err
	}
	return zr, nil
}
989167
func NewReader(src io.Reader) (*Reader, error) {
	var err error

	result := &Reader{}

	result.cmd = exec.Command("xz", "--decompress", "--stdout")
	result.input, err = result.cmd.StdinPipe()
	if err != nil {
		return nil, err
	}
	result.output, err = result.cmd.StdoutPipe()
	if err != nil {
		return nil, err
	}

	err = result.cmd.Start()
	if err != nil {
		return nil, err
	}

	go func() {
		io.Copy(result.input, src)
		result.input.Close()
	}()

	return result, nil
}
906105
func NewReader(rd io.Reader) *Reader {
	mr := new(Reader)
	mr.Reset(rd)
	return mr
}
260072
func (t *Torrent) NewReader() Reader {
	r := reader{
		mu:        t.cl.locker(),
		t:         t,
		readahead: 5 * 1024 * 1024,
		length:    *t.length,
	}
	t.addReader(&r)
	return &r
}
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}
}
1037288
func NewDecoder(r io.Reader) *Decoder {
	return &Decoder{r, defaultDelimiter, defaultEscape, false, false}
}
853166
func NewFromReader(reader io.Reader) (GCSCli, error) {

	dec := json.NewDecoder(reader)
	var c GCSCli
	if err := dec.Decode(&c); err != nil {
		return GCSCli{}, err
	}

	if c.BucketName == "" {
		return GCSCli{}, ErrEmptyBucketName
	}

	if c.CredentialsSource == ServiceAccountFileCredentialsSource &&
		c.ServiceAccountFile == "" {
		return GCSCli{}, ErrEmptyServiceAccountFile
	}

	if len(c.EncryptionKey) != 32 && c.EncryptionKey != nil {
		return GCSCli{}, ErrWrongLengthEncryptionKey
	}

	return c, nil
}
214045
func NewReader(getReaderFunc func(offset, length int64) (io.ReadCloser, error), args *ReaderArgs) (*Reader, error) {
	reader, err := parquetgo.NewReader(getReaderFunc, nil)
	if err != nil {
		if err != io.EOF {
			return nil, errParquetParsingError(err)
		}

		return nil, err
	}

	return &Reader{
		args:   args,
		reader: reader,
	}, nil
}
1035366
func NewReader(checker connpool.MySQLChecker, config tabletenv.TabletConfig) *Reader {
	if !config.HeartbeatEnable {
		return &Reader{}
	}

	return &Reader{
		enabled:  true,
		now:      time.Now,
		interval: config.HeartbeatInterval,
		ticks:    timer.NewTimer(config.HeartbeatInterval),
		errorLog: logutil.NewThrottledLogger("HeartbeatReporter", 60*time.Second),
		pool:     connpool.New(config.PoolNamePrefix+"HeartbeatReadPool", 1, time.Duration(config.IdleTimeout*1e9), checker),
	}
}