This is automatic generated document for things in Swow\Buffer class
Class Buffer
Constants
This constant holds page size of this machine, it’s platform-dependent.
At Linux mips64 and macOS arm64 platforms, this constant may have a value 16384
Methods
Static method alignSize
Method __construct
Method __debugInfo
Returns array<string, mixed>
debug information for var_dump
Method __serialize
Method __toString
Method __unserialize
Method alloc
Method append
append $string
to the end of buffer
$start
and $length
is for input $string
Returns int
bytes written
Throws \ValueError
when specified $start
, $offset
or $length
not in range
Method clear
Method close
Method dupString
Method extend
Param int
$recommendSize [optional] = $this->getSize() * 2
Method fetchString
Method getAvailableSize
Method getLength
Method getLocker
Method getSize
Method isAvailable
Method isEmpty
Method isFull
Method isLocked
Method lock
Method mallocTrim
Method prepare
Method read
read at max $length
bytes data from start
Returns string
data read
Throws \ValueError
when specified $start
and $length
not in range
Method realloc
Method toString
Method truncate
Returns int
length of buffer after truncate
Method truncateFrom
Param int
$offset [optional] = $this->getOffset()
Returns int
length of buffer after truncate
Method tryLock
Method unlock
Method write
write $string
to buffer
$start
and $length
is for input $string
$offset
is for output $buffer
Returns int
bytes written
Throws \ValueError
when specified $start
, $offset
or $length
not in range