@@ -130,8 +130,8 @@ public static UoSound GetSound(int soundId, out bool translated)
130130 var stringBuffer = new byte [ 32 ] ;
131131 var buffer = new byte [ length ] ;
132132
133- stream . Read ( stringBuffer , 0 , 32 ) ;
134- stream . Read ( buffer , 0 , length ) ;
133+ stream . ReadExactly ( stringBuffer , 0 , 32 ) ;
134+ stream . ReadExactly ( buffer , 0 , length ) ;
135135 stream . Close ( ) ;
136136
137137 var resultBuffer = new byte [ buffer . Length + ( waveHeader . Length << 2 ) ] ;
@@ -233,7 +233,7 @@ public static bool IsValidSound(int soundId, out string name, out bool translate
233233 }
234234
235235 var stringBuffer = new byte [ 32 ] ;
236- stream . Read ( stringBuffer , 0 , 32 ) ;
236+ stream . ReadExactly ( stringBuffer , 0 , 32 ) ;
237237 stream . Close ( ) ;
238238 name = Encoding . ASCII . GetString ( stringBuffer ) ; // seems that the null terminator's not being properly recognized :/
239239 if ( name . IndexOf ( '\0 ' ) > 0 )
@@ -303,7 +303,7 @@ public static void Add(int id, string name, string file)
303303 {
304304 byte [ ] resultBuffer = new byte [ wav . Length ] ;
305305 wav . Seek ( 0 , SeekOrigin . Begin ) ;
306- wav . Read ( resultBuffer , 0 , ( int ) wav . Length ) ;
306+ wav . ReadExactly ( resultBuffer , 0 , ( int ) wav . Length ) ;
307307
308308 resultBuffer = CheckAndFixWave ( resultBuffer ) ;
309309
@@ -376,7 +376,7 @@ public static void Save(string path)
376376 {
377377 m . Seek ( headerLength , SeekOrigin . Begin ) ;
378378 var resultBuffer = new byte [ m . Length - headerLength ] ;
379- m . Read ( resultBuffer , 0 , ( int ) m . Length - headerLength ) ;
379+ m . ReadExactly ( resultBuffer , 0 , ( int ) m . Length - headerLength ) ;
380380 binmul . Write ( resultBuffer ) ;
381381 }
382382
0 commit comments