protected function detect(array $registries)
    {
        $length = max(array_map('strlen', $registries));

        $found = false;
        foreach (self::DETECT_LAYOUT as $cnab => $start) {
            if ($length <= $cnab) {
                $found = true;
                break;
            }
        }

        if (!$found) {
            throw new \DomainException('Could not detect Return File layout');
        }

        $this->bank_code = substr($registries[0], $start, 3);
        $this->cnab = $cnab;
    }