You are here

public static function Reader::resolveTwoByteBigEndian in Drupal 7

Parameters

string $content:

int $start:

Return value

int

1 call to Reader::resolveTwoByteBigEndian()
Manifest::fromContent in misc/typo3/phar-stream-wrapper/src/Phar/Manifest.php

File

misc/typo3/phar-stream-wrapper/src/Phar/Reader.php, line 235

Class

Reader

Namespace

TYPO3\PharStreamWrapper\Phar

Code

public static function resolveTwoByteBigEndian($content, $start) {
  $payload = substr($content, $start, 2);
  if (!is_string($payload)) {
    throw new ReaderException(sprintf('Cannot resolve value at offset %d', $start), 1539614263);
  }
  $value = unpack('n', $payload);
  if (!isset($value[1])) {
    throw new ReaderException(sprintf('Cannot resolve value at offset %d', $start), 1539614264);
  }
  return $value[1];
}