code: private function flushReadBuffer(int $flushSize)
      {
          $bufferSize = strlen($this->readBuffer);
          if ($flushSize === $bufferSize) {
              $this->readBuffer = '';
          } else {
              $this->readBuffer = substr(
                  $this->readBuffer,
                  $flushSize,
                  $bufferSize - $flushSize
              );
          }
      }
docs: Сброс буфера чтения.
  
  @param int $flushSize Размер данных для сброса
  
  @return void