/// <summary> /// Parses the byte-array to UInt64. /// </summary> /// <returns>The user interface nt64.</returns> /// <param name="bytes">Bytes.</param> /// <param name="offset">Offset.</param> public static ulong ParseUInt64(byte[] bytes, ref int offset) { var readBytes = 0; var newBytes = new byte[bytes.Length - offset]; Array.Copy(bytes, offset, newBytes, 0, bytes.Length - offset); var ulongResult = VarintBitConverter.ToUInt64(newBytes, out readBytes); offset += readBytes; return(ulongResult); }
/// <summary> /// Parses the byte-array to UInt64. /// </summary> /// <returns>The user interface nt64.</returns> /// <param name="bytes">Bytes.</param> public static ulong ParseUInt64(byte[] bytes) { return(VarintBitConverter.ToUInt64(bytes)); }
/// <summary> /// Parses the stream to UInt64. /// </summary> /// <returns>The user interface nt64.</returns> /// <param name="stream">Stream.</param> public static ulong ParseUInt64(Stream stream) { var byteArray = ParseStreamToByteArray(stream); return(VarintBitConverter.ToUInt64(byteArray)); }