예제 #1
0
            /// <summary>
            /// Initializes a new instance of the <see cref="Fat"/> class.
            /// </summary>
            /// <param name="fileSystem">The file system.</param>
            /// <param name="fatSector">The first sector of the FAT table.</param>
            public Fat(FatFileSystem fileSystem, ulong fatSector)
            {
                if (fileSystem == null)
                {
                    throw new ArgumentNullException(nameof(fileSystem));
                }

                FileSystem = fileSystem;
                FatSector  = fatSector;
            }
예제 #2
0
 public FatStream(FatDirectoryEntry entry)
 {
     DirectoryEntry = entry ?? throw new ArgumentNullException(nameof(entry));
     FS             = entry.GetFileSystem();
     FatTable       = entry.GetFatTable();
     Size           = entry.Size;
     if (FatTable == null)
     {
         throw new Exception("The fat chain returned for the directory entry was null.");
     }
 }
예제 #3
0
        public FatDirectoryEntry(FatFileSystem fileSystem, FatDirectoryEntry parent, string fullPath, long size, string name, uint firstCluster)
            : base(fileSystem, parent, fullPath, name, size, DirectoryEntryType.Directory)
        {
            if (firstCluster < fileSystem.RootCluster)
            {
                throw new ArgumentOutOfRangeException(nameof(firstCluster));
            }

            FirstClusterNum       = firstCluster;
            EntryHeaderDataOffset = 0;
        }