public function read($bytes=0)
    {
        // If the connection wrote into the resource the handle will be placed
        // at the end and nothing will be returned
        if ($this->didWrite) {
            $this->stream = null;
        }

        if (!$bytes) {
            return $this->stream()->toString();
        }

        $stream = $this->stream();
        $stream->setChunkSize($bytes);

        if (!$stream->isOpen()) {
            $stream->rewind();
        } else {
            $stream->next();
        }

        return $stream->current();
    }
public function read($bytes=0)
    {
        // If the connection wrote into the resource the handle will be placed
        // at the end and nothing will be returned
        if ($this->didWrite) {
            $this->stream = null;
        }

        if (!$bytes) {
            return $this->stream()->toString();
        }

        $stream = $this->stream();
        $stream->setChunkSize($bytes);

        if (!$stream->isOpen()) {
            $stream->rewind();
        } else {
            $stream->next();
        }

        return $stream->current();
    }
public function read ( $ bytes = 0 ) { // If the connection wrote into the resource the handle will be placed // at the end and nothing will be returned if ( $ this -> didWrite ) { $ this -> stream = null ; } if ( ! $ bytes ) { return $ this -> stream ( ) -> toString ( ) ; } $ stream = $ this -> stream ( ) ; $ stream -> setChunkSize ( $ bytes ) ; if ( ! $ stream -> isOpen ( ) ) { $ stream -> rewind ( ) ; } else { $ stream -> next ( ) ; } return $ stream -> current ( ) ; }
Read some bytes from the connection. This is handled by read

@param int $bytes
@return string
Read some bytes from the connection . This is handled by read