@@ 43-53 (lines=11) @@ | ||
40 | return $this->open(); |
|
41 | } |
|
42 | ||
43 | public function stream_read($count) { |
|
44 | $result = parent::stream_read($count); |
|
45 | ||
46 | $bytesReceived = strlen($result); |
|
47 | while ($bytesReceived < $count && !$this->stream_eof()) { |
|
48 | $result .= parent::stream_read($count - $bytesReceived); |
|
49 | $bytesReceived = strlen($result); |
|
50 | } |
|
51 | ||
52 | return $result; |
|
53 | } |
|
54 | ||
55 | public function stream_write($data) { |
|
56 | $bytesToSend = strlen($data); |
|
@@ 55-65 (lines=11) @@ | ||
52 | return $result; |
|
53 | } |
|
54 | ||
55 | public function stream_write($data) { |
|
56 | $bytesToSend = strlen($data); |
|
57 | $result = parent::stream_write($data); |
|
58 | ||
59 | while ($result < $bytesToSend && !$this->stream_eof()) { |
|
60 | $dataLeft = substr($data, $result); |
|
61 | $result += parent::stream_write($dataLeft); |
|
62 | } |
|
63 | ||
64 | return $result; |
|
65 | } |
|
66 | } |
|
67 |