Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

(no description)

File Size: 157 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

LimitStream:: (8 methods):
  __construct()
  eof()
  getSize()
  seek()
  tell()
  setOffset()
  setLimit()
  read()


Class: LimitStream  - X-Ref

Decorator used to return only a subset of a stream.

__construct(StreamInterface $stream,int $limit = -1,int $offset = 0)   X-Ref

param: StreamInterface $stream Stream to wrap
param: int             $limit  Total number of bytes to allow to be read
param: int             $offset Position to seek to before reading (only

eof()   X-Ref
No description

getSize()   X-Ref
Returns the size of the limited subset of data


seek($offset, $whence = SEEK_SET)   X-Ref
Allow for a bounded seek on the read limited stream


tell()   X-Ref
Give a relative tell()


setOffset(int $offset)   X-Ref
Set the offset to start limiting from

param: int $offset Offset to seek to and begin byte limiting from

setLimit(int $limit)   X-Ref
Set the limit of bytes that the decorator allows to be read from the
stream.

param: int $limit Number of bytes to allow to be read from the stream.

read($length)   X-Ref
No description