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)
522522
523523 public class SBRException : Exception
524524 {
525+ static long GetPosition ( BinaryBlockReader sbr )
526+ {
527+ if ( sbr . InputStream . BaseStream is DeflateStream ) return - 1 ;
528+ return sbr . InputStream . BaseStream . Position ;
529+ }
530+
525531 public static void TraceWarning ( BinaryBlockReader sbr , string message )
526532 {
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 ) ;
528534 }
529535
530536 public static void TraceInformation ( BinaryBlockReader sbr , string message )
531537 {
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 ) ;
533539 }
534540
535541 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 ) )
537543 {
538544 }
539545 }
You can’t perform that action at this time.
0 commit comments