@@ -502,7 +502,17 @@ public string ReadPrintableAsciiString(int offset, int length)
502502 return sb . ToString ( ) ;
503503 }
504504
505- private string ReadString ( Encoding encoding , int offset , int length )
505+ public string ReadString ( Encoding encoding , IntPtr offset , int length )
506+ {
507+ Contract . Requires ( encoding != null ) ;
508+ Contract . Requires ( offset . ToInt32 ( ) >= 0 ) ;
509+ Contract . Requires ( length >= 0 ) ;
510+ Contract . Ensures ( Contract . Result < string > ( ) != null ) ;
511+
512+ return ReadString ( encoding , offset . ToInt32 ( ) , length ) ;
513+ }
514+
515+ public string ReadString ( Encoding encoding , int offset , int length )
506516 {
507517 Contract . Requires ( encoding != null ) ;
508518 Contract . Requires ( offset >= 0 ) ;
@@ -525,33 +535,6 @@ private string ReadString(Encoding encoding, int offset, int length)
525535 return sb . ToString ( ) ;
526536 }
527537
528- public string ReadUtf8String ( IntPtr offset , int length )
529- {
530- Contract . Requires ( offset . ToInt32 ( ) >= 0 ) ;
531- Contract . Requires ( length >= 0 ) ;
532- Contract . Ensures ( Contract . Result < string > ( ) != null ) ;
533-
534- return ReadString ( Encoding . UTF8 , offset . ToInt32 ( ) , length ) ;
535- }
536-
537- public string ReadUtf16String ( IntPtr offset , int length )
538- {
539- Contract . Requires ( offset . ToInt32 ( ) >= 0 ) ;
540- Contract . Requires ( length >= 0 ) ;
541- Contract . Ensures ( Contract . Result < string > ( ) != null ) ;
542-
543- return ReadString ( Encoding . Unicode , offset . ToInt32 ( ) , length ) ;
544- }
545-
546- public string ReadUtf32String ( IntPtr offset , int length )
547- {
548- Contract . Requires ( offset . ToInt32 ( ) >= 0 ) ;
549- Contract . Requires ( length >= 0 ) ;
550- Contract . Ensures ( Contract . Result < string > ( ) != null ) ;
551-
552- return ReadString ( Encoding . UTF32 , offset . ToInt32 ( ) , length ) ;
553- }
554-
555538 public bool HasChanged ( IntPtr offset , int length )
556539 {
557540 return HasChanged ( offset . ToInt32 ( ) , length ) ;
0 commit comments