MySql.Data.MySqlClient.MySqlPacket.ReadLong C# (CSharp) Метод

ReadLong() публичный Метод

public ReadLong ( int numbytes ) : long
numbytes int
Результат long
    public long ReadLong(int numbytes)
    {
      Debug.Assert((buffer.Position + numbytes) <= buffer.Length);
      byte[] bytes = buffer.GetBuffer();
      int pos = (int)buffer.Position;
      buffer.Position += numbytes;
      switch (numbytes)
      {
        case 2: return BitConverter.ToUInt16(bytes, pos);
        case 4: return BitConverter.ToUInt32(bytes, pos);
        case 8: return BitConverter.ToInt64(bytes, pos);
      }
      throw new NotSupportedException("Only byte lengths of 2, 4, or 8 are supported");
    }