BinderTool.Program.TryGetUnicodeSignature(System.IO.MemoryStream, int, out string)

Here are the examples of the csharp api class BinderTool.Program.TryGetUnicodeSignature(System.IO.MemoryStream, int, out string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: BinderTool
Source File: Program.cs
View license
private static string GetDataExtension(MemoryStream data)
        {
            string signature;
            string extension;

            if (TryGetAsciiSignature(data, 4, out signature)
                && TryGetFileExtension(signature, out extension))
            {
                return extension;
            }

            if (TryGetUnicodeSignature(data, 4, out signature)
                && TryGetFileExtension(signature, out extension))
            {
                return extension;
            }

            if (TryGetAsciiSignature(data, 26, out signature)
                && TryGetFileExtension(signature.Substring(12, 14), out extension))
            {
                return extension;
            }

            //Debug.WriteLine($"Unknown signature: '{BitConverter.ToString(Encoding.ASCII.GetBytes(signature)).Replace("-", " ")}'");
            return ".bin";
        }