remove() 공개 메소드

Remove and return the given number of characters (at most) from the buffer.
public remove ( integer $length, integer $offset ) : string
$length integer
$offset integer
리턴 string
예제 #1
0
 public function testApiRemove_RemovesAndReturnsValidData_WhenInvalidOffsetIsPassed()
 {
     $length = 10;
     $offset = -1;
     $result = $this->buffer->remove($length, $offset);
     $this->assertSame(substr($this->initialString, 0, $length), $result);
     $this->assertSame(substr($this->initialString, $length), (string) $this->buffer);
 }
예제 #2
0
 /**
  *
  */
 private function writeEnd()
 {
     do {
         try {
             $sent = fwrite($this->resource, $this->buffer->peek());
             $this->buffer->remove($sent);
         } catch (Error $ex) {
             $sent = 0;
         } catch (Exception $ex) {
             $sent = 0;
         }
     } while (is_resource($this->resource) && $sent > 0 && !$this->buffer->isEmpty());
 }