Rewinds the file pointer to the beginning.
778117
function rewind()
	{
		$filename = $this->getResource();

		if( fclose( $this->_fh ) === false ) {
			throw new MW_Container_Exception( sprintf( 'Unable to close file handle for %1$s', $filename ) );
		}

		if( ( $this->_fh = fopen( $filename, 'r' ) ) === false ) {
			throw new MW_Container_Exception( sprintf( 'Unable to open file %1$s', $filename ) );
		}

		$this->_position = 0;
		$this->_data = $this->_getData();
	}
275250
public function rewind()
    {
        parent::rewind();
        $this->_values->rewind();
        $this->_validValues = $this->_values->valid();
    }
1076769
def flush(self):
        
        if self._writable:
            with self._seek_lock:
                buffer = self._get_buffer()

                # Flush that part of the file
                end = self._seek
                start = end - len(buffer)

                # Clear buffer
                self._write_buffer = bytearray()

            # Flush content
            with handle_os_exceptions():
                self._flush(buffer, start, end)
474897
final public function rewind()
    {
        $this->results = null;
        $this->offset = 0;
        $this->total = 0;
        $this->limit = 0;
        $this->position = -1;
    }
1065666
public function rewind()
    {
        if ($this->cacheFilesIterator === null) {
            $this->cacheFilesIterator = new \DirectoryIterator($this->cacheDirectory);
        }
        $this->cacheFilesIterator->rewind();
        while (substr($this->cacheFilesIterator->getFilename(), 0, 1) === '.' && $this->cacheFilesIterator->valid()) {
            $this->cacheFilesIterator->next();
        }
    }
701626
private void rewind(long index) {
    if (currentSegment.index() >= index) {
      JournalSegment<E> segment = journal.getSegment(index - 1);
      if (segment != null) {
        currentReader.close();
        currentSegment.release();
        currentSegment = segment;
        currentSegment.acquire();
        currentReader = currentSegment.createReader();
      }
    }

    currentReader.reset(index);
    previousEntry = currentReader.getCurrentEntry();
  }
337178
@Override
    public void rewind(int count) throws IOException
    {
        if (count < 0)
        {
            throw new IllegalArgumentException("negative rewind "+count);
        }
        cursor -= count;
        if (cursor < end - size || cursor < 0)
        {
            throw new IOException("insufficient room in the pushback buffer");
        }
        length -= count;
        if (length < 0)
        {
            throw new IOException("rewinding past input");
        }
        int ld = 0;
        for (int ii=0;ii<count;ii++)
        {
            if (get((cursor+ii)) == '\n')
            {
                ld++;
            }
        }
        if (ld > 0)
        {
            int l = includeLevel.line;
            includeLevel.line = l - ld;
            int c = 0;
            long start = Math.max(0, end-size);
            for (long ii=cursor;ii>=start;ii--)
            {
                if (get(ii) == '\n')
                {
                    break;
                }
                c++;
            }
            includeLevel.column = c;
        }
        else
        {
            int c = includeLevel.column;
            includeLevel.column = c - count;
        }
    }
914132
public function rewind()
    {
        if (false === $this->isRewindable()) {
            return;
        }

        // @see https://bugs.php.net/68557
        if (PHP_VERSION_ID < 50523 || PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50607) {
            parent::next();
        }

        parent::rewind();
    }
393021
private synchronized void rotate() {
        Level oldLevel = getLevel();
        setLevel(Level.OFF);

        super.close();
        for (int i = count-2; i >= 0; i--) {
            File f1 = files[i];
            File f2 = files[i+1];
            if (f1.exists()) {
                if (f2.exists()) {
                    f2.delete();
                }
                f1.renameTo(f2);
            }
        }
        try {
            open(files[0], false);
        } catch (IOException ix) {
            // We don't want to throw an exception here, but we
            // report the exception to any registered ErrorManager.
            reportError(null, ix, ErrorManager.OPEN_FAILURE);

        }
        setLevel(oldLevel);
    }
840739
def reopen(self):
      """"""
      # Read any remaining content in the file and store it in a buffer.
      self._read()
      # Close it to ensure we don't leak file descriptors
      self._close()
      
      # Reopen the file.
      try:
         self._open(self._path, skip_to_end = False)
         return True
      except OSError:
         # If opening fails, it was probably deleted.
         return False
208115
protected void reBuffer()
    {
        resetBuffer();

        try
        {
            int read = buffer.length;
            if (bufferOffset + read > fileLength)
            {
                if (bufferOffset >= fileLength)
                    return;
                read = (int) (fileLength - bufferOffset);
            }

            channel.position(bufferOffset); // setting channel position

            int offset = 0;
            while (read > 0)
            {
                int n = super.read(buffer, offset, read);
                if (n < 0)
                    throw new IllegalStateException();
                read -= n;
                offset += n;
            }

            validBufferBytes = offset;
        }
        catch (IOException e)
        {
            throw new FSReadError(e, filePath);
        }
    }
18974
public function rewind()
    {
        if ($this->hasHeadline()) {
            $this->updateHeadline();
            $lineNumber = 1;
        } else {
            $lineNumber = 0;
        }
        $this->initialLineNumber = $lineNumber;
        $this->seekFileToCurrentLineNumberIfNeeded(
            $this->getFileHandler(),
            $lineNumber
        );
    }
929563
public function rewind()
    {
        $cursor = $this;
        $this->retry(function() use ($cursor) {
            $cursor->getRiakCursor()->rewind();
        }, false);
    }
1035763
public function rewind()
    {
        if ($this->isOpen() === false) {
            $msg = "Cannot call rewind() on a closed MemoryStream.";
            throw new MemoryStreamException($msg, $this, MemoryStreamException::NOT_OPEN);
        }

        $this->setPosition(0);
    }
754843
public function rewind()
    {
        // @codeCoverageIgnoreStart
        $meta = $this->getMetadata();
        if ($meta['wrapper_type'] === 'PHP' && strtolower($meta['stream_type']) === 'input') {
            $this->handle = fopen($meta['uri'], $meta['mode']);
        }
        // @codeCoverageIgnoreEnd

        $this->seek(0, SEEK_SET);
    }
1324788
public function rewind()
    {
        $this->xmlReader->close();

        if ($this->xmlReader->openFileInZip($this->filePath, self::CONTENT_XML_FILE_PATH) === false) {
            $contentXmlFilePath = $this->filePath . '#' . self::CONTENT_XML_FILE_PATH;
            throw new IOException("Could not open \"{$contentXmlFilePath}\".");
        }

        try {
            $this->hasFoundSheet = $this->xmlReader->readUntilNodeFound(self::XML_NODE_TABLE);
        } catch (XMLProcessingException $exception) {
           throw new IOException("The content.xml file is invalid and cannot be read. [{$exception->getMessage()}]");
       }

        $this->currentSheetIndex = 0;
    }
975147
public void rewindNbytes(int N)
   {
      int bits = (N << 3);
	  totbit -= bits;
	  buf_byte_idx -= bits;	  
	  if (buf_byte_idx<0)
		  buf_byte_idx += BUFSIZE;
   }