1 | <?php |
||
18 | class StringStream implements StreamInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var string $buffer Stores the string to use |
||
22 | */ |
||
23 | protected $buffer; |
||
24 | |||
25 | /** |
||
26 | * StringStream constructor. |
||
27 | * |
||
28 | * @param string $string |
||
29 | */ |
||
30 | public function __construct(string $string) |
||
34 | |||
35 | |||
36 | /** |
||
37 | * @inheritDoc |
||
38 | * |
||
39 | * @throws \RouterOS\Exceptions\StreamException |
||
40 | */ |
||
41 | public function read(int $length): string |
||
67 | |||
68 | /** |
||
69 | * @inheritDoc |
||
70 | * |
||
71 | * @throws \InvalidArgumentException on invalid length |
||
72 | */ |
||
73 | public function write(string $string, int $length = null): int |
||
85 | |||
86 | /** |
||
87 | * @inheritDoc |
||
88 | */ |
||
89 | public function close(): void |
||
93 | } |
||
94 |