1 | <?php |
||
7 | class BufferIO implements IOInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | private $writeBuffer; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $readBuffer; |
||
18 | |||
19 | /** |
||
20 | * @param string $readBuffer |
||
21 | */ |
||
22 | 18 | public function __construct($readBuffer = '') |
|
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | 1 | public function open($protocol, $host, $port, array $parameters = []) |
|
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | 1 | public function close() |
|
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | 11 | public function read($length, $blocking = true) |
|
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | 5 | public function write($data, $length = null) |
|
67 | |||
68 | /** |
||
69 | * @param string $data |
||
70 | * |
||
71 | * @return $this |
||
72 | */ |
||
73 | 9 | public function push($data) |
|
79 | |||
80 | /** |
||
81 | * @param null $length |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | 4 | public function pop($length = null) |
|
97 | } |
||
98 |