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); }
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; }