Ver Fonte

:octocat: added BitBuffer::rewind()

smiley há 2 anos atrás
pai
commit
3ded3d45a6
1 ficheiros alterados com 10 adições e 2 exclusões
  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
 	 * Clears the buffer and resets the stats
 	 */
 	 */
 	public function clear():self{
 	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->bytesRead = 0;
 		$this->bitsRead  = 0;
 		$this->bitsRead  = 0;