diff --git a/src/Common/BitBuffer.php b/src/Common/BitBuffer.php index 9cd0547fe..eba9ec29b 100644 --- a/src/Common/BitBuffer.php +++ b/src/Common/BitBuffer.php @@ -159,8 +159,16 @@ final class BitBuffer{ * Clears the buffer and resets the stats */ public function clear():self{ - $this->buffer = []; - $this->length = 0; + $this->buffer = []; + $this->length = 0; + + return $this->rewind(); + } + + /** + * Resets the read-counters + */ + public function rewind():self{ $this->bytesRead = 0; $this->bitsRead = 0;