Ejemplo n.º 1
0
        private static CommonCatalogFileInfo ParseDirEntryData(byte[] dirEntryData)
        {
            CatalogRecordType type = (CatalogRecordType)Utilities.ToInt16BigEndian(dirEntryData, 0);

            CommonCatalogFileInfo result = null;

            switch (type)
            {
            case CatalogRecordType.FolderRecord:
                result = new CatalogDirInfo();
                break;

            case CatalogRecordType.FileRecord:
                result = new CatalogFileInfo();
                break;

            default:
                throw new NotImplementedException("Unknown catalog record type: " + type);
            }

            result.ReadFrom(dirEntryData, 0);
            return(result);
        }
Ejemplo n.º 2
0
        private static CommonCatalogFileInfo ParseDirEntryData(byte[] dirEntryData)
        {
            CatalogRecordType type = (CatalogRecordType)Utilities.ToInt16BigEndian(dirEntryData, 0);

            CommonCatalogFileInfo result = null;
            switch (type)
            {
                case CatalogRecordType.FolderRecord:
                    result = new CatalogDirInfo();
                    break;
                case CatalogRecordType.FileRecord:
                    result = new CatalogFileInfo();
                    break;
                default:
                    throw new NotImplementedException("Unknown catalog record type: " + type);
            }

            result.ReadFrom(dirEntryData, 0);
            return result;
        }