PHP 7.4.0RC2 Released!

EventBuffer::pullup

(PECL event >= 1.2.6-beta)

EventBuffer::pullupLinearizes data within buffer and returns it's contents as a string

Описание

public EventBuffer::pullup ( int $size ) : string

"Linearizes" the first size bytes of the buffer, copying or moving them as needed to ensure that they are all contiguous and occupying the same chunk of memory. If size is negative, the function linearizes the entire buffer.

Внимание

Calling EventBuffer::pullup() with a large size can be quite slow, since it potentially needs to copy the entire buffer's contents.

Список параметров

size

The number of bytes required to be contiguous within the buffer.

Возвращаемые значения

If size is greater than the number of bytes in the buffer, the function returns NULL. Otherwise, EventBuffer::pullup() returns string.

Смотрите также

  • EventBuffer::copyout() - Копирует указанное количество байтов с начала буфера
  • EventBuffer::drain() - Удаляет указанное количество байтов с начала буфера, никуда не копируя
  • EventBuffer::read() - Read data from an evbuffer and drain the bytes read
  • EventBuffer::readLine() - Extracts a line from the front of the buffer
  • EventBuffer::appendFrom() - Перемещает указанное количество байтов из исходного буфера в конец текущего буфера
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top