static CharSequence generateFileHeader(
        final String packageName,
        final Set<String> packageNamesByTypes,
        final String... topLevelStatements)
    {
        final StringBuilder additionalUsingBuilder = new StringBuilder();
        if (packageNamesByTypes != null && !packageNamesByTypes.isEmpty())
        {
            packageNamesByTypes
                .stream()
                .filter(p -> !packageName.equals(p))
                .forEach(p ->
                additionalUsingBuilder
                .append("using ")
                .append(formatNamespace(p))
                .append(";\n"));

            additionalUsingBuilder.append("\n");
        }

        return String.format(
            "// <auto-generated>\n" +
            "//     Generated SBE (Simple Binary Encoding) message codec\n" +
            "// </auto-generated>\n\n" +
            "#pragma warning disable 1591 // disable warning on missing comments\n" +
            "%1$s" +
            "using System;\n" +
            "using System.Text;\n" +
            "using Org.SbeTool.Sbe.Dll;\n\n" +
            "%2$s" +
            "namespace %3$s\n" +
            "{\n",
            String.join("", topLevelStatements),
            additionalUsingBuilder,
            formatNamespace(packageName));
    }
Utilities for mapping between IR and the C# language.
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/csharp/CSharpUtil.java