File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -522,18 +522,24 @@ public override void ThrowException(string message)
522
522
523
523
public class SBRException : Exception
524
524
{
525
+ static long GetPosition ( BinaryBlockReader sbr )
526
+ {
527
+ if ( sbr . InputStream . BaseStream is DeflateStream ) return - 1 ;
528
+ return sbr . InputStream . BaseStream . Position ;
529
+ }
530
+
525
531
public static void TraceWarning ( BinaryBlockReader sbr , string message )
526
532
{
527
- Trace . TraceWarning ( "{2} in {0}:byte {1}" , sbr . Filename , sbr . InputStream . BaseStream . Position , message ) ;
533
+ Trace . TraceWarning ( "{2} in {0}:byte {1}" , sbr . Filename , GetPosition ( sbr ) , message ) ;
528
534
}
529
535
530
536
public static void TraceInformation ( BinaryBlockReader sbr , string message )
531
537
{
532
- Trace . TraceInformation ( "{2} in {0}:byte {1}" , sbr . Filename , sbr . InputStream . BaseStream . Position , message ) ;
538
+ Trace . TraceInformation ( "{2} in {0}:byte {1}" , sbr . Filename , GetPosition ( sbr ) , message ) ;
533
539
}
534
540
535
541
public SBRException ( BinaryBlockReader sbr , string message )
536
- : base ( String . Format ( "{2} in {0}:byte {1}\n " , sbr . Filename , sbr . InputStream . BaseStream . Position , message ) )
542
+ : base ( String . Format ( "{2} in {0}:byte {1}\n " , sbr . Filename , GetPosition ( sbr ) , message ) )
537
543
{
538
544
}
539
545
}
You can’t perform that action at this time.
0 commit comments