protected static function binarySubstr($s, $p, $len = null)
    {
        if ($len === null) {
            $ret = substr($s, $p);
        } else {
            $ret = substr($s, $p, $len);
        }

        if ($ret === false) {
            $ret = '';
        }

        return $ret;
    }