File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -209,8 +209,7 @@ protected bool ReadBoolean()
209
209
/// <returns>uint16 read</returns>
210
210
protected ushort ReadUInt16 ( )
211
211
{
212
- var data = ReadBytes ( 2 ) ;
213
- return ( ushort ) ( data [ 0 ] << 8 | data [ 1 ] ) ;
212
+ return Pack . BigEndianToUInt16 ( ReadBytes ( 2 ) ) ;
214
213
}
215
214
216
215
/// <summary>
@@ -219,8 +218,7 @@ protected ushort ReadUInt16()
219
218
/// <returns>uint32 read</returns>
220
219
protected uint ReadUInt32 ( )
221
220
{
222
- var data = ReadBytes ( 4 ) ;
223
- return ( uint ) ( data [ 0 ] << 24 | data [ 1 ] << 16 | data [ 2 ] << 8 | data [ 3 ] ) ;
221
+ return Pack . BigEndianToUInt32 ( ReadBytes ( 4 ) ) ;
224
222
}
225
223
226
224
/// <summary>
@@ -229,8 +227,7 @@ protected uint ReadUInt32()
229
227
/// <returns>uint64 read</returns>
230
228
protected ulong ReadUInt64 ( )
231
229
{
232
- var data = ReadBytes ( 8 ) ;
233
- return ( ( ulong ) data [ 0 ] << 56 | ( ulong ) data [ 1 ] << 48 | ( ulong ) data [ 2 ] << 40 | ( ulong ) data [ 3 ] << 32 | ( ulong ) data [ 4 ] << 24 | ( ulong ) data [ 5 ] << 16 | ( ulong ) data [ 6 ] << 8 | data [ 7 ] ) ;
230
+ return Pack . BigEndianToUInt64 ( ReadBytes ( 8 ) ) ;
234
231
}
235
232
236
233
/// <summary>
You can’t perform that action at this time.
0 commit comments