Changeset 1745 for branches/eraser6/CodeReview/Eraser.DefaultPlugins/ErasureMethods/FirstLast16KB.cs
- Timestamp:
- 2/3/2010 3:37:13 AM (2 years ago)
- Location:
- branches/eraser6/CodeReview
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
Eraser.DefaultPlugins/ErasureMethods/FirstLast16KB.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/CodeReview
- Property svn:mergeinfo changed
/branches/eraser6/6.0 merged: 1721,1723,1730,1732,1734-1735,1737-1738,1740,1742 /trunk/eraser6 merged: 1706-1743
- Property svn:mergeinfo changed
-
branches/eraser6/CodeReview/Eraser.DefaultPlugins/ErasureMethods/FirstLast16KB.cs
r1681 r1745 113 113 "limited, since this is a self-limiting erasure method.")); 114 114 115 //If the target stream is shorter than 16kb, just forward it to the default116 // function.117 if (strm.Length < dataSize )115 //If the target stream is shorter than or equal to 32kb, just forward it to 116 //the default function. 117 if (strm.Length < dataSize * 2) 118 118 { 119 119 method.Erase(strm, erasureLength, prng, callback); … … 121 121 } 122 122 123 //We need to intercept the callback function as we run the erasure method 124 //twice on two parts of the file. 125 ErasureMethodProgressFunction customCallback = 126 delegate(long lastWritten, long totalData, int currentPass) 127 { 128 callback(lastWritten, dataSize * 2, currentPass); 129 }; 130 123 131 //Seek to the beginning and write 16kb. 124 132 strm.Seek(0, SeekOrigin.Begin); 125 method.Erase(strm, dataSize, prng, callback );133 method.Erase(strm, dataSize, prng, callback == null ? null: customCallback); 126 134 127 135 //Seek to the end - 16kb, and write. 128 136 strm.Seek(-dataSize, SeekOrigin.End); 129 method.Erase(strm, long.MaxValue, prng, callback );137 method.Erase(strm, long.MaxValue, prng, callback == null ? null : customCallback); 130 138 } 131 139
Note: See TracChangeset
for help on using the changeset viewer.
