Protobuf\Stream::getContents PHP Метод

getContents() публичный Метод

Returns the remaining contents of the stream as a string.
public getContents ( ) : string
Результат string
    public function getContents()
    {
        if (!$this->stream) {
            return '';
        }
        $this->seek(0);
        return stream_get_contents($this->stream);
    }

Usage Example

Пример #1
0
 public function testGetsContents()
 {
     $handle = fopen('php://temp', 'w+');
     $stream = new Stream($handle);
     fwrite($handle, 'data');
     $this->assertEquals('data', $stream->getContents());
 }