// Read implements the io.Reader interface on a FTP data connection.
187195
func (r *Response) Read(buf []byte) (int, error) {
	return r.conn.Read(buf)
}
793065
func (f *httpFile) Read(p []byte) (n int, err error) {
	if f.reader == nil && f.isDir {
		return 0, io.EOF
	}
	return f.reader.Read(p)
}
271946
func read(path string) ([]byte, error) {
	f, err := os.Open(path)
	if err != nil {
		return nil, err
	}
	defer f.Close()

	d, err := ioutil.ReadAll(f)
	if err != nil {
		return nil, err
	}
	return d, nil
}
1202221
func (c *Conn) Read(p []byte) (int, error) {
	i, err := c.NetConn.Read(p)
	return i, err
}
942626
func (c *Conn) Read(b []byte) (int, error) {
	if !c.ok() {
		return 0, syscall.EINVAL
	}
	if !c.isOpen() {
		return 0, &net.OpError{
			Op:   "read",
			Net:  c.LocalAddr().Network(),
			Addr: c.LocalAddr(),
			Err:  errClosing,
		}
	}
	s := c.readbuf.space()
	c.deadlineMutex.RLock()
	d := timeToDeadline(c.rdeadline)
	c.deadlineMutex.RUnlock()
	l, err := c.readbuf.ReadTimeout(b, d)
	if s < mss && c.readbuf.space() > 0 {
		select {
		case c.ackch <- 0:
		default:
		}
	}
	return l, err
}
1293610
func (c *Conn) Read(p []byte) (int, error) {
	return c.reader.Read(p)
}
852878
func (p *StreamTransport) Read(buf []byte) (int, error) {
	if p.Reader == nil {
		return 0, NewTTransportException(NOT_OPEN, "Cannot read from null inputStream")
	}
	n, err := p.Reader.Read(buf)
	return n, NewTTransportExceptionFromError(err)
}
830242
func (c *Conn) Read(b []byte) (int, error) {
	n, err := c.fd.Read(b)
	if err != nil {
		return n, c.opError(opRead, err)
	}

	return n, nil
}
270691
func (c *conn) Read(b []byte) (int, error) {
	return c.buf.Read(b)
}
761085
func (c *Conn) Read(out []byte) (n int, err error) {

	c.readMutex.Lock()
	defer c.readMutex.Unlock()

	// The first error kills the whole stream
	if err = c.getErrorForRead(); err != nil {
		return 0, err
	}
	// First see if there's anything buffered, and read that
	// out now.
	if n, err = c.readBufferedMsgsIntoBytes(out); err != nil {
		return 0, c.setReadError(err)
	}
	if n > 0 {
		return n, nil
	}

	var poll time.Duration
	if !c.readDeadline.IsZero() {
		poll = c.readDeadline.Sub(time.Now())
		if poll.Nanoseconds() < 0 {
			return 0, c.setReadError(ErrTimedOut)
		}
	} else {
		poll = c.readTimeout
	}

	var msgs [][]byte
	msgs, err = c.pollLoop(poll)

	if err != nil {
		return 0, c.setReadError(err)
	}
	if _, err = c.decryptIncomingMessages(msgs); err != nil {
		return 0, c.setReadError(err)
	}
	if n, err = c.readBufferedMsgsIntoBytes(out); err != nil {
		return 0, c.setReadError(err)
	}

	if n == 0 {
		switch {
		case c.getClosed():
			c.lctx.Debug("conn#Read: EOF since connection was closed")
			err = io.EOF
		case poll > 0:
			err = ErrTimedOut
		default:
			err = ErrAgain
		}
	}

	return n, err
}
1077691
func (c *Connection) read() string {
	reply, err := c.bufin.ReadString('\n')

	if err != nil {
		fmt.Println("e ", err)
	}
	return reply
}
489625
func (f *FileReader) Read(b []byte) (int, error) {
	if f.closed {
		return 0, io.ErrClosedPipe
	}

	if f.info.IsDir() {
		return 0, &os.PathError{
			"read",
			f.name,
			errors.New("is a directory"),
		}
	}

	if f.offset >= f.info.Size() {
		return 0, io.EOF
	}

	if len(b) == 0 {
		return 0, nil
	}

	if f.blocks == nil {
		err := f.getBlocks()
		if err != nil {
			return 0, err
		}
	}

	if f.blockReader == nil {
		err := f.getNewBlockReader()
		if err != nil {
			return 0, err
		}
	}

	for {
		n, err := f.blockReader.Read(b)
		f.offset += int64(n)

		if err != nil && err != io.EOF {
			f.blockReader.Close()
			f.blockReader = nil
			return n, err
		} else if n > 0 {
			return n, nil
		} else {
			f.blockReader.Close()
			f.getNewBlockReader()
		}
	}
}
680037
func (p *conn) Read(b []byte) (int, error) {
	var err error
	p.initOnce.Do(func() { err = p.checkPrefix() })
	if err != nil {
		return 0, err
	}
	if p.connBuf != nil {
		n := copy(b, p.connBuf)
		p.connBuf = p.connBuf[n:]
		if len(p.connBuf) == 0 {
			p.connBuf = nil
		}
		if len(b) == n {
			return n, nil
		}
		readN, err := p.Conn.Read(b[n:])
		return readN + n, err
	}
	return p.Conn.Read(b)
}
982738
func (ff *FileFragment) Read(b []byte) (n int, err error) {
	offset, err := ff.file.Seek(0, io.SeekCurrent)
	if err != nil {
		return 0, err
	}

	if int64(len(b)) > ff.endLoc-offset {
		n, err := ff.file.Read(b[:ff.endLoc-offset])
		if int64(n) == ff.endLoc-offset {
			return n, io.EOF
		}
		return n, err
	}
	return ff.file.Read(b)
}
1117753
func (f *File) Read() (io.ReadSeeker, error) {
	if f.HasPermission(roles.Read) {
		return os.Open(f.FilePath)
	}
	return nil, roles.ErrPermissionDenied
}
917249
func (f *Conn) Read(b []byte) (n int, err error) {
	total := 0

	if f.bytesLeft <= 0 {
		frameSize, err := f.readSize()
		if err != nil {
			return total, err
		}
		f.bytesLeft = frameSize
	}
	n, err = io.ReadFull(f.Conn, b[:min(f.bytesLeft, len(b))])
	f.bytesLeft -= n
	return
}
1086317
func Read(r io.Reader, data ...interface{}) error {
	for _, v := range data {
		if err := binary.Read(r, binary.BigEndian, v); err != nil {
			return err
		}
	}

	return nil
}