diff --git a/src/Buffertools/Parser.php b/src/Buffertools/Parser.php index 5ca477c..22d1af2 100644 --- a/src/Buffertools/Parser.php +++ b/src/Buffertools/Parser.php @@ -30,14 +30,12 @@ class Parser */ public function __construct(BufferInterface $input = null) { - $this->position = 0; - - if (null === $input) { - $this->string = ''; - $this->size = 0; - } else { + if ($input instanceof BufferInterface) { $this->string = $input->getBinary(); $this->size = $input->getSize(); + } else { + $this->string = ''; + $this->size = 0; } }