Ejemplo n.º 1
0
		IMySqlValue IMySqlValue.ReadValue(MySqlStream stream, long length, bool nullVal) {
			if (nullVal) {
				return new MySqlDouble(true);
			}
			if (length == -1L) {
				byte[] buffer = new byte[8];
				stream.Read(buffer, 0, 8);
				return new MySqlDouble(BitConverter.ToDouble(buffer, 0));
			}
			return new MySqlDouble(double.Parse(stream.ReadString(length), CultureInfo.InvariantCulture));
		}
Ejemplo n.º 2
0
        private void SendFileToServer(string filename)
        {
            byte[]     buffer = new byte[0x2004];
            FileStream stream = null;
            long       num    = 0L;

            try {
                int num2;
                stream = new FileStream(filename, FileMode.Open);
                for (num = stream.Length; num > 0L; num -= num2)
                {
                    num2 = stream.Read(buffer, 4, (num > 0x2000L) ? ((int)0x2000L) : ((int)num));
                    this.stream.SendEntirePacketDirectly(buffer, num2);
                }
                this.stream.SendEntirePacketDirectly(buffer, 0);
            } catch (Exception exception) {
                throw new MySqlException("Error during LOAD DATA LOCAL INFILE", exception);
            } finally {
                stream.Close();
            }
        }
Ejemplo n.º 3
0
		IMySqlValue IMySqlValue.ReadValue(MySqlStream stream, long length, bool nullVal) {
			MySqlBinary binary;
			if (nullVal) {
				binary = new MySqlBinary(this.type, true);
			} else {
				if (length == -1L) {
					length = stream.ReadFieldLength();
				}
				byte[] buffer = new byte[length];
				stream.Read(buffer, 0, (int)length);
				binary = new MySqlBinary(this.type, buffer);
			}
			binary.IsGuid = this.IsGuid;
			return binary;
		}
Ejemplo n.º 4
0
		private void SendFileToServer(string filename) {
			byte[] buffer = new byte[0x2004];
			FileStream stream = null;
			long num = 0L;
			try {
				int num2;
				stream = new FileStream(filename, FileMode.Open);
				for (num = stream.Length; num > 0L; num -= num2) {
					num2 = stream.Read(buffer, 4, (num > 0x2000L) ? ((int)0x2000L) : ((int)num));
					this.stream.SendEntirePacketDirectly(buffer, num2);
				}
				this.stream.SendEntirePacketDirectly(buffer, 0);
			} catch (Exception exception) {
				throw new MySqlException("Error during LOAD DATA LOCAL INFILE", exception);
			} finally {
				stream.Close();
			}
		}