original_string: private function initBufferFromCurrentChunk()
      {
          if ($this->chunkOffset === 0 && $this->numChunks === 0) {
              return false;
          }
  
          if ( ! $this->chunksIterator->valid()) {
              throw CorruptFileException::missingChunk($this->chunkOffset);
          }
  
          $currentChunk = $this->chunksIterator->current();
  
          if ($currentChunk->n !== $this->chunkOffset) {
              throw CorruptFileException::unexpectedIndex($currentChunk->n, $this->chunkOffset);
          }
  
          $this->buffer = $currentChunk->data->getData();
  
          $actualChunkSize = strlen($this->buffer);
  
          $expectedChunkSize = ($this->chunkOffset === $this->numChunks - 1)
              ? $this->expectedLastChunkSize
              : $this->chunkSize;
  
          if ($actualChunkSize !== $expectedChunkSize) {
              throw CorruptFileException::unexpectedSize($actualChunkSize, $expectedChunkSize);
          }
  
          return true;
      }
code: private function initBufferFromCurrentChunk()
      {
          if ($this->chunkOffset === 0 && $this->numChunks === 0) {
              return false;
          }
  
          if ( ! $this->chunksIterator->valid()) {
              throw CorruptFileException::missingChunk($this->chunkOffset);
          }
  
          $currentChunk = $this->chunksIterator->current();
  
          if ($currentChunk->n !== $this->chunkOffset) {
              throw CorruptFileException::unexpectedIndex($currentChunk->n, $this->chunkOffset);
          }
  
          $this->buffer = $currentChunk->data->getData();
  
          $actualChunkSize = strlen($this->buffer);
  
          $expectedChunkSize = ($this->chunkOffset === $this->numChunks - 1)
              ? $this->expectedLastChunkSize
              : $this->chunkSize;
  
          if ($actualChunkSize !== $expectedChunkSize) {
              throw CorruptFileException::unexpectedSize($actualChunkSize, $expectedChunkSize);
          }
  
          return true;
      }
code_tokens: private function initBufferFromCurrentChunk ( ) { if ( $ this -> chunkOffset === 0 && $ this -> numChunks === 0 ) { return false ; } if ( ! $ this -> chunksIterator -> valid ( ) ) { throw CorruptFileException :: missingChunk ( $ this -> chunkOffset ) ; } $ currentChunk = $ this -> chunksIterator -> current ( ) ; if ( $ currentChunk -> n !== $ this -> chunkOffset ) { throw CorruptFileException :: unexpectedIndex ( $ currentChunk -> n , $ this -> chunkOffset ) ; } $ this -> buffer = $ currentChunk -> data -> getData ( ) ; $ actualChunkSize = strlen ( $ this -> buffer ) ; $ expectedChunkSize = ( $ this -> chunkOffset === $ this -> numChunks - 1 ) ? $ this -> expectedLastChunkSize : $ this -> chunkSize ; if ( $ actualChunkSize !== $ expectedChunkSize ) { throw CorruptFileException :: unexpectedSize ( $ actualChunkSize , $ expectedChunkSize ) ; } return true ; }
docstring: Initialize the buffer to the current chunk's data.
  
  @return boolean Whether there was a current chunk to read
  @throws CorruptFileException if an expected chunk could not be read successfully
docstring_tokens: Initialize the buffer to the current chunk s data .