public ulong ReadBitValue(int numbytes)
{
ulong value = 0;
int pos = (int)buffer.Position;
byte[] bits = buffer.GetBuffer();
int shift = 0;
for (int i = 0; i < numbytes; i++)
{
value <<= shift;
value |= bits[pos++];
shift = 8;
}
buffer.Position += numbytes;
return value;
}
public IMySqlValue ReadValue(MySqlPacket packet, long length, bool isNull) { this.isNull = isNull; if (isNull) return this; if (length == -1) length = packet.ReadFieldLength(); if (ReadAsString) mValue = UInt64.Parse(packet.ReadString(length)); else mValue = (UInt64)packet.ReadBitValue((int)length); return this; }