Ejemplo n.º 1
0
        public static void Convert(byte[] inputBytes, string outputFilename, XofFileFormats format)
        {
            if (inputBytes == null)
            {
                throw new ArgumentNullException(nameof(inputBytes));
            }

            if (inputBytes.Length == 0)
            {
                throw new ArgumentOutOfRangeException(nameof(inputBytes));
            }

            if (string.IsNullOrEmpty(outputFilename))
            {
                throw new ArgumentNullException(nameof(outputFilename));
            }

            using (var enumObject = XofFile.OpenEnumObject(inputBytes))
                using (var saveObject = XofFile.OpenSaveObject(outputFilename, format))
                {
                    ConvertObject(enumObject, saveObject);

                    saveObject.Save();
                }
        }
        public static void WriteFile(XFile file, string fileName, XofFileFormats format)
        {
            using (var saveObject = XofFile.OpenSaveObject(fileName, format))
            {
                WriteFile(file, saveObject);

                saveObject.Save();
            }
        }
Ejemplo n.º 3
0
        public static void Convert(string inputFilename, string outputFilename, XofFileFormats format)
        {
            if (string.IsNullOrEmpty(inputFilename))
            {
                throw new ArgumentNullException(nameof(inputFilename));
            }

            if (string.IsNullOrEmpty(outputFilename))
            {
                throw new ArgumentNullException(nameof(outputFilename));
            }

            using (var enumObject = XofFile.OpenEnumObject(inputFilename))
                using (var saveObject = XofFile.OpenSaveObject(outputFilename, format))
                {
                    ConvertObject(enumObject, saveObject);

                    saveObject.Save();
                }
        }