Ejemplo n.º 1
0
		IMySqlValue IMySqlValue.ReadValue(MySqlStream stream, long length, bool nullVal) {
			if (nullVal) {
				return new MySqlUByte(true);
			}
			if (length == -1L) {
				return new MySqlUByte((byte)stream.ReadByte());
			}
			return new MySqlUByte(byte.Parse(stream.ReadString(length)));
		}
Ejemplo n.º 2
0
		IMySqlValue IMySqlValue.ReadValue(MySqlStream stream, long length, bool nullVal) {
			if (nullVal) {
				return new MySqlTimeSpan(true);
			}
			if (length >= 0L) {
				string s = stream.ReadString(length);
				this.ParseMySql(s, stream.Version.isAtLeast(4, 1, 0));
				return this;
			}
			long num = stream.ReadByte();
			int num2 = 0;
			if (num > 0L) {
				num2 = stream.ReadByte();
			}
			this.isNull = false;
			switch (num) {
				case 0L:
					this.isNull = true;
					break;

				case 5L:
					this.mValue = new TimeSpan(stream.ReadInteger(4), 0, 0, 0);
					break;

				case 8L:
					this.mValue = new TimeSpan(stream.ReadInteger(4), stream.ReadByte(), stream.ReadByte(), stream.ReadByte());
					break;

				default:
					this.mValue = new TimeSpan(stream.ReadInteger(4), stream.ReadByte(), stream.ReadByte(), stream.ReadByte(), stream.ReadInteger(4) / 0xf4240);
					break;
			}
			if (num2 == 1) {
				this.mValue = this.mValue.Negate();
			}
			return this;
		}
Ejemplo n.º 3
0
		public IMySqlValue ReadValue(MySqlStream stream, long length, bool isNull) {
			this.isNull = isNull;
			if (!isNull) {
				if (this.buffer == null) {
					this.buffer = new byte[8];
				}
				if (length == -1L) {
					length = stream.ReadFieldLength();
				}
				Array.Clear(this.buffer, 0, this.buffer.Length);
				for (long i = length - 1L; i >= 0L; i -= 1L) {
					this.buffer[(int)((IntPtr)i)] = (byte)stream.ReadByte();
				}
				this.mValue = BitConverter.ToUInt64(this.buffer, 0);
			}
			return this;
		}
Ejemplo n.º 4
0
		void IMySqlValue.SkipValue(MySqlStream stream) {
			long num = stream.ReadByte();
			stream.SkipBytes((int)num);
		}
Ejemplo n.º 5
0
		IMySqlValue IMySqlValue.ReadValue(MySqlStream stream, long length, bool nullVal) {
			if (nullVal) {
				return new MySqlDateTime(this.type, true);
			}
			if (length >= 0L) {
				string s = stream.ReadString(length);
				return this.ParseMySql(s, stream.Version.isAtLeast(4, 1, 0));
			}
			long num = stream.ReadByte();
			int year = 0;
			int month = 0;
			int day = 0;
			int hour = 0;
			int minute = 0;
			int second = 0;
			if (num >= 4L) {
				year = stream.ReadInteger(2);
				month = stream.ReadByte();
				day = stream.ReadByte();
			}
			if (num > 4L) {
				hour = stream.ReadByte();
				minute = stream.ReadByte();
				second = stream.ReadByte();
			}
			if (num > 7L) {
				stream.ReadInteger(4);
			}
			return new MySqlDateTime(this.type, year, month, day, hour, minute, second);
		}
Ejemplo n.º 6
0
		void IMySqlValue.SkipValue(MySqlStream stream) {
			stream.ReadByte();
		}
Ejemplo n.º 7
0
		void IMySqlValue.SkipValue(MySqlStream stream) {
			int len = stream.ReadByte();
			stream.SkipBytes(len);
		}