Skip to main content Link Menu Expand (external link) Document Search Copy Copied

This is automatic generated document for things in Swow\Stream\LengthStream class

Class LengthStream

Properties

protected $format protected $formatSize protected $internalBuffer

Methods

Method __construct

public function __construct ( string $format , int $type )

Method accept

public function accept ( ?int $timeout ) : static

Method getFormat

public function getFormat ( ) : string

Method getFormatSize

public function getFormatSize ( ) : int

Method recvMessage

public function recvMessage ( Buffer $buffer , ?int $offset , ?int $timeout ) : int

Param ?int $offset default value is $buffer->getLength()

Returns int message length

Method recvMessageString

public function recvMessageString ( ?int $timeout ) : string

Method sendMessage

public function sendMessage ( string|Stringable $string , int $start , int $length , ?int $timeout ) : static

Method sendMessageChunks

public function sendMessageChunks ( non-empty-array<(string | Stringable | Buffer | array{0: (string | Stringable | Buffer), 1?: int, 2?: int} | null)> $chunks , ?int $timeout ) : static

Method setFormat

public function setFormat ( string $format ) : static

Copyright 2022 the Swow contributors