public override void WriteToStream(Stream outputStream) { if (NpgsqlEventLog.Level >= LogLevel.Debug) { // Log the string being sent. // If (this) was constructed with a byte[], then commandText has to be // initialized before the first Log call. if (commandText == null) { commandText = BackendEncoding.UTF8Encoding.GetString(commandBytes); commandBytes = null; } PGUtil.LogStringWritten(commandText); } outputStream.WriteBytes(pgCommandBytes); }