\Drupal\strata\Storage ByteRange

A byte range for a partial read.

Reading one frame out of a 1 MiB pack is the common case; without a range the whole pack comes down to serve a few kilobytes.

Summary

Methods
Properties
Constants
__construct
end
toHeader
offset
length
No public constants found
No protected methods found
No protected properties found
No protected constants found
No private methods found
No private properties found
No private constants found

Properties

$offset

$offset : int

Type

int

$length

$length : int

Type

int

Methods

__construct()

__construct(int  $offset, int  $length) : mixed

Constructs a range.

Parameters

int $offset

First byte to read, counting from zero.

int $length

How many bytes to read.

Throws

\InvalidArgumentException

When the offset is negative or the length is not positive. A zero-length range is refused rather than returning an empty string, since it is always a caller bug.

Returns

mixed —

end()

end() : int

The last byte the range covers, inclusive.

Returns

int —

The end offset.

toHeader()

toHeader() : string

The range as an HTTP Range header value.

Returns

string —

A value such as "bytes=0-16383".