Browse Source

:octocat: added BitBuffer::rewind()

smiley 2 years ago
parent
commit
3ded3d45a6
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/Common/BitBuffer.php

+ 10 - 2
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;