Source/NFX/IOMiscUtils.cs
/// <summary>
/// Reads an integer encoded as little endian from buffer at the specified index
/// </summary>
Reads an integer encoded as little endian from buffer at the specified index
Reads an integer encoded as little endian from buffer at the specified index
public static ulong ReadLEUInt64(this Stream s)
        {
           var b1 = s.ReadByte();
           if (b1<0) throw new IO.NFXIOException(StringConsts.STREAM_READ_EOF_ERROR+"ReadLEUInt64()");
           var b2 = s.ReadByte();
           if (b2<0) throw new IO.NFXIOException(StringConsts.STREAM_READ_EOF_ERROR+"ReadLEUInt64()");
           var b3 = s.ReadByte();
           if (b3<0) throw new IO.NFXIOException(StringConsts.STREAM_READ_EOF_ERROR+"ReadLEUInt64()");
           var b4 = s.ReadByte();
           if (b4<0) throw new IO.NFXIOException(StringConsts.STREAM_READ_EOF_ERROR+"ReadLEUInt64()");
           var b5 = s.ReadByte();
           if (b5<0) throw new IO.NFXIOException(StringConsts.STREAM_READ_EOF_ERROR+"ReadLEUInt64()");
           var b6 = s.ReadByte();
           if (b6<0) throw new IO.NFXIOException(StringConsts.STREAM_READ_EOF_ERROR+"ReadLEUInt64()");
           var b7 = s.ReadByte();
           if (b7<0) throw new IO.NFXIOException(StringConsts.STREAM_READ_EOF_ERROR+"ReadLEUInt64()");
           var b8 = s.ReadByte();
           if (b8<0) throw new IO.NFXIOException(StringConsts.STREAM_READ_EOF_ERROR+"ReadLEUInt64()");
          return ((ulong)b8 << 56) +
                 ((ulong)b7 << 48) +
                 ((ulong)b6 << 40) +
                 ((ulong)b5 << 32) +
                 ((ulong)b4 << 24) +
                 ((ulong)b3 << 16) +
                 ((ulong)b2 << 8)  +
                 ((ulong)b1) ;
        }
public static ulong ReadLEUInt64 ( this Stream s ) { var b1 = s . ReadByte ( ) ; if ( b1 < 0 ) throw new IO . NFXIOException ( StringConsts . STREAM_READ_EOF_ERROR + " " ) ; var b2 = s . ReadByte ( ) ; if ( b2 < 0 ) throw new IO . NFXIOException ( StringConsts . STREAM_READ_EOF_ERROR + " " ) ; var b3 = s . ReadByte ( ) ; if ( b3 < 0 ) throw new IO . NFXIOException ( StringConsts . STREAM_READ_EOF_ERROR + " " ) ; var b4 = s . ReadByte ( ) ; if ( b4 < 0 ) throw new IO . NFXIOException ( StringConsts . STREAM_READ_EOF_ERROR + " " ) ; var b5 = s . ReadByte ( ) ; if ( b5 < 0 ) throw new IO . NFXIOException ( StringConsts . STREAM_READ_EOF_ERROR + " " ) ; var b6 = s . ReadByte ( ) ; if ( b6 < 0 ) throw new IO . NFXIOException ( StringConsts . STREAM_READ_EOF_ERROR + " " ) ; var b7 = s . ReadByte ( ) ; if ( b7 < 0 ) throw new IO . NFXIOException ( StringConsts . STREAM_READ_EOF_ERROR + " " ) ; var b8 = s . ReadByte ( ) ; if ( b8 < 0 ) throw new IO . NFXIOException ( StringConsts . STREAM_READ_EOF_ERROR + " " ) ; return ( ( ulong ) b8 << 56 ) + ( ( ulong ) b7 << 48 ) + ( ( ulong ) b6 << 40 ) + ( ( ulong ) b5 << 32 ) + ( ( ulong ) b4 << 24 ) + ( ( ulong ) b3 << 16 ) + ( ( ulong ) b2 << 8 ) + ( ( ulong ) b1 ) ; }
Reads an integer encoded as little endian from buffer at the specified index
Reads an integer encoded as little endian from buffer at the specified index
Stream
this