2
abstract class VIRTUALStreamReaderWriter extends VIRTUALStreamObject implements STREAMReaderInterface {
5
function StreamData(STREAMWriterInterface $h = NULL, $flags = 0) {
6
if ($this->output) $h = $this->output;
7
else if (!$h) throw new ADEIException(translate("The data routing is failed (there is no output specified for STREAMReader)"));
10
$data = $this->ReadData(STREAM::BUFFER_SIZE, $flags);
11
if ($data) $h->WriteData($data, $flags);
15
function Stream(STREAMWriterInterface $h = NULL, $flags = 0) {
16
if ($this->output) $h = $this->output;
17
else if (!$h) throw new ADEIException(translate("The data routing is failed (there is no output specified for STREAMReader)"));
19
while (!$this->EOS($flags)) {
20
$data = $this->ReadData(STREAM::BUFFER_SIZE, $flags|STREAM::BLOCK);
21
if ($data) $h->WriteData($data, $flags);
25
function GetContent($flags = 0) {
27
while (!$this->EOS($flags)) {
28
$data = $this->ReadData(0, $flags|STREAM::BLOCK);
29
if ($data) $res .= $data;
b'\\ No newline at end of file'