public FATFileStream (FAT fs, uint startCluster, uint directorySector, uint directoryIndex) { this.fs = fs; this.clusterSize = fs.ClusterSizeInBytes; this.data = new byte[clusterSize]; this.startCluster = startCluster; this.directorySector = directorySector; this.directoryIndex = directoryIndex; this.read = true; this.write = false; this.position = -1; this.dirty = false; this.nthCluster = UInt32.MaxValue; // Not positioned yet this.lengthOnDisk = fs.GetFileSize (directorySector, directoryIndex); this.length = this.lengthOnDisk; if (length != 0) ReadCluster (startCluster); }
public FATFileStream(FAT fs, uint startCluster, uint directorySector, uint directoryIndex) { this.fs = fs; this.clusterSize = fs.ClusterSizeInBytes; this.data = new byte[clusterSize]; this.startCluster = startCluster; this.directorySector = directorySector; this.directoryIndex = directoryIndex; this.read = true; this.write = false; this.position = -1; this.dirty = false; this.nthCluster = UInt32.MaxValue; // Not positioned yet this.lengthOnDisk = fs.GetFileSize(directorySector, directoryIndex); this.length = this.lengthOnDisk; if (length != 0) { ReadCluster(startCluster); } }