@@ -99,7 +99,7 @@ public int Crc32Result
99
99
get
100
100
{
101
101
// return one's complement of the running result
102
- return unchecked ( ( int ) ( ~ runningCrc32Result ) ) ;
102
+ return unchecked ( ( int ) ( ~ this . runningCrc32Result ) ) ;
103
103
}
104
104
}
105
105
@@ -110,7 +110,7 @@ public int Crc32Result
110
110
/// <returns>the CRC32 calculation</returns>
111
111
public int GetCrc32 ( Stream input )
112
112
{
113
- return GetCrc32AndCopy ( input , null ) ;
113
+ return this . GetCrc32AndCopy ( input , null ) ;
114
114
}
115
115
116
116
/// <summary>
@@ -132,26 +132,26 @@ public int GetCrc32AndCopy(Stream input, Stream output)
132
132
byte [ ] buffer = new byte [ BUFFER_SIZE ] ;
133
133
const int readSize = BUFFER_SIZE ;
134
134
135
- TotalBytesRead = 0 ;
135
+ this . TotalBytesRead = 0 ;
136
136
int count = input . Read ( buffer , 0 , readSize ) ;
137
137
138
138
if ( output != null )
139
139
output . Write ( buffer , 0 , count ) ;
140
140
141
- TotalBytesRead += count ;
141
+ this . TotalBytesRead += count ;
142
142
143
143
while ( count > 0 )
144
144
{
145
- SlurpBlock ( buffer , 0 , count ) ;
145
+ this . SlurpBlock ( buffer , 0 , count ) ;
146
146
count = input . Read ( buffer , 0 , readSize ) ;
147
147
148
148
if ( output != null )
149
149
output . Write ( buffer , 0 , count ) ;
150
150
151
- TotalBytesRead += count ;
151
+ this . TotalBytesRead += count ;
152
152
}
153
153
154
- return ( int ) ( ~ runningCrc32Result ) ;
154
+ return ( int ) ( ~ this . runningCrc32Result ) ;
155
155
}
156
156
}
157
157
@@ -164,7 +164,7 @@ public int GetCrc32AndCopy(Stream input, Stream output)
164
164
/// <returns>The CRC-ized result.</returns>
165
165
public int ComputeCrc32 ( int w , byte b )
166
166
{
167
- return InternalComputeCrc32 ( ( uint ) w , b ) ;
167
+ return this . InternalComputeCrc32 ( ( uint ) w , b ) ;
168
168
}
169
169
170
170
internal int InternalComputeCrc32 ( uint w , byte b )
@@ -188,10 +188,10 @@ public void SlurpBlock(byte[] block, int offset, int count)
188
188
{
189
189
int x = offset + i ;
190
190
191
- runningCrc32Result = ( ( runningCrc32Result ) >> 8 ) ^ crc32Table [ ( block [ x ] ) ^ ( ( runningCrc32Result ) & 0x000000FF ) ] ;
191
+ this . runningCrc32Result = ( ( this . runningCrc32Result ) >> 8 ) ^ crc32Table [ ( block [ x ] ) ^ ( ( this . runningCrc32Result ) & 0x000000FF ) ] ;
192
192
}
193
193
194
- TotalBytesRead += count ;
194
+ this . TotalBytesRead += count ;
195
195
}
196
196
}
197
197
@@ -282,10 +282,10 @@ public CrcCalculatorStream(Stream stream, long length, bool leaveOpen)
282
282
// value.
283
283
private CrcCalculatorStream ( bool leaveOpen , long length , Stream stream )
284
284
{
285
- innerStream = stream ;
286
- crc32 = new Crc32 ( ) ;
287
- lengthLimit = length ;
288
- LeaveOpen = leaveOpen ;
285
+ this . innerStream = stream ;
286
+ this . crc32 = new Crc32 ( ) ;
287
+ this . lengthLimit = length ;
288
+ this . LeaveOpen = leaveOpen ;
289
289
}
290
290
291
291
/// <summary>
@@ -296,12 +296,12 @@ private CrcCalculatorStream(bool leaveOpen, long length, Stream stream)
296
296
/// This is either the total number of bytes read, or the total number of bytes
297
297
/// written, depending on the direction of this stream.
298
298
/// </remarks>
299
- public long TotalBytesSlurped { get { return crc32 . TotalBytesRead ; } }
299
+ public long TotalBytesSlurped { get { return this . crc32 . TotalBytesRead ; } }
300
300
301
301
/// <summary>
302
302
/// Provides the current CRC for all blocks slurped in.
303
303
/// </summary>
304
- public int Crc { get { return crc32 . Crc32Result ; } }
304
+ public int Crc { get { return this . crc32 . Crc32Result ; } }
305
305
306
306
/// <summary>
307
307
/// Indicates whether the underlying stream will be left open when the
@@ -328,21 +328,21 @@ public override int Read(byte[] buffer, int offset, int count)
328
328
// calling ReadToEnd() on it, We can "over-read" the zip data and get a
329
329
// corrupt string. The length limits that, prevents that problem.
330
330
331
- if ( lengthLimit != UNSET_LENGTH_LIMIT )
331
+ if ( this . lengthLimit != UNSET_LENGTH_LIMIT )
332
332
{
333
- if ( crc32 . TotalBytesRead >= lengthLimit )
333
+ if ( this . crc32 . TotalBytesRead >= this . lengthLimit )
334
334
return 0 ; // EOF
335
335
336
- long bytesRemaining = lengthLimit - crc32 . TotalBytesRead ;
336
+ long bytesRemaining = this . lengthLimit - this . crc32 . TotalBytesRead ;
337
337
338
338
if ( bytesRemaining < count )
339
339
bytesToRead = ( int ) bytesRemaining ;
340
340
}
341
341
342
- int n = innerStream . Read ( buffer , offset , bytesToRead ) ;
342
+ int n = this . innerStream . Read ( buffer , offset , bytesToRead ) ;
343
343
344
344
if ( n > 0 )
345
- crc32 . SlurpBlock ( buffer , offset , n ) ;
345
+ this . crc32 . SlurpBlock ( buffer , offset , n ) ;
346
346
347
347
return n ;
348
348
}
@@ -356,57 +356,57 @@ public override int Read(byte[] buffer, int offset, int count)
356
356
public override void Write ( byte [ ] buffer , int offset , int count )
357
357
{
358
358
if ( count > 0 )
359
- crc32 . SlurpBlock ( buffer , offset , count ) ;
359
+ this . crc32 . SlurpBlock ( buffer , offset , count ) ;
360
360
361
- innerStream . Write ( buffer , offset , count ) ;
361
+ this . innerStream . Write ( buffer , offset , count ) ;
362
362
}
363
363
364
364
/// <summary>
365
365
/// Indicates whether the stream supports reading.
366
366
/// </summary>
367
367
public override bool CanRead
368
368
{
369
- get { return innerStream . CanRead ; }
369
+ get { return this . innerStream . CanRead ; }
370
370
}
371
371
372
372
/// <summary>
373
373
/// Indicates whether the stream supports seeking.
374
374
/// </summary>
375
375
public override bool CanSeek
376
376
{
377
- get { return innerStream . CanSeek ; }
377
+ get { return this . innerStream . CanSeek ; }
378
378
}
379
379
380
380
/// <summary>
381
381
/// Indicates whether the stream supports writing.
382
382
/// </summary>
383
383
public override bool CanWrite
384
384
{
385
- get { return innerStream . CanWrite ; }
385
+ get { return this . innerStream . CanWrite ; }
386
386
}
387
387
388
388
/// <summary>
389
389
/// Flush the stream.
390
390
/// </summary>
391
391
public override void Flush ( )
392
392
{
393
- innerStream . Flush ( ) ;
393
+ this . innerStream . Flush ( ) ;
394
394
}
395
395
396
396
/// <summary>
397
397
/// Not implemented.
398
398
/// </summary>
399
399
public override long Length
400
400
{
401
- get { return lengthLimit == UNSET_LENGTH_LIMIT ? innerStream . Length : lengthLimit ; }
401
+ get { return this . lengthLimit == UNSET_LENGTH_LIMIT ? this . innerStream . Length : this . lengthLimit ; }
402
402
}
403
403
404
404
/// <summary>
405
405
/// Not implemented.
406
406
/// </summary>
407
407
public override long Position
408
408
{
409
- get { return crc32 . TotalBytesRead ; }
409
+ get { return this . crc32 . TotalBytesRead ; }
410
410
set { throw new NotImplementedException ( ) ; }
411
411
}
412
412
@@ -432,7 +432,7 @@ public override void SetLength(long value)
432
432
433
433
void IDisposable . Dispose ( )
434
434
{
435
- Close ( ) ;
435
+ this . Close ( ) ;
436
436
}
437
437
438
438
/// <summary>
@@ -442,8 +442,8 @@ public override void Close()
442
442
{
443
443
base . Close ( ) ;
444
444
445
- if ( ! LeaveOpen )
446
- innerStream . Close ( ) ;
445
+ if ( ! this . LeaveOpen )
446
+ this . innerStream . Close ( ) ;
447
447
}
448
448
}
449
449
}
0 commit comments