protected function determineByteOrder()
    {
        $orderHeader = fread($this->file, 4);

        if ($orderHeader == "\x95\x04\x12\xde") {
            $this->littleEndian = false;
        } elseif ($orderHeader == "\xde\x12\x04\x95") {
            $this->littleEndian = true;
        } else {
            fclose($this->file);
            throw new \Exception(
                sprintf(
                    '%s is not a valid gettext file',
                    $this->filename
                )
            );
        }
    }