Changeset 1725
- Timestamp:
- 1/30/2010 2:15:30 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser6/Eraser.DefaultPlugins/ErasureMethods/FirstLast16KB.cs
r1675 r1725 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.
