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(); } }
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(); } }
IMySqlValue IMySqlValue.ReadValue(MySqlStream stream, long length, bool nullVal) { if (nullVal) { return new MySqlSingle(true); } if (length == -1L) { byte[] buffer = new byte[4]; stream.Read(buffer, 0, 4); return new MySqlSingle(BitConverter.ToSingle(buffer, 0)); } return new MySqlSingle(float.Parse(stream.ReadString(length), CultureInfo.InvariantCulture)); }
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; }