ToInt64() public static method

Constructs a System.Int64 from bytes at a given offset in a byte array.
public static ToInt64 ( byte array, int startIndex ) : long
array byte The array with the bytes to use.
startIndex int The offset at which the number starts.
return long
Exemplo n.º 1
0
 /// <inheritdoc />
 public bool TryReadInt64(out long value)
 {
     if (CanAdvance(8))
     {
         int start = UncheckedAdvance(8);
         value = LittleEndianBitConverter.ToInt64(_buffer, start);
         return(true);
     }
     else
     {
         return(Misc.Fail(out value));
     }
 }
Exemplo n.º 2
0
        /// <inheritdoc />
        /// <inheritdoc cref="CheckedAdvance" select="exception[@cref='PacketReadingException']" />
        public long ReadInt64()
        {
            int start = CheckedAdvance(8);

            return(LittleEndianBitConverter.ToInt64(_buffer, start));
        }