首页 \ 问答 \ 如何在不删除电子邮件的情况下删除Gmail附件?(How Remove Gmail Attachments In Place Without Deleting Email?)

如何在不删除电子邮件的情况下删除Gmail附件?(How Remove Gmail Attachments In Place Without Deleting Email?)

我想使用Gmail-API执行以下操作。

打开Gmail邮件(现在可以)
阅读内容(现在可以做)
阅读附件(现在可以做)
更新邮件正文(如何操作?)
删除附件并更新现有电子邮件(如何操作?)

我的问题是如何做“如何做?” 以上。


I'd like to do the following with the Gmail-API.

Open a gmail message (Can do now)
Read the contents (Can do now)
Read the attachments (Can do now)
Update the message body (HOW TO DO?)
Remove the attachments and Update the existing email (HOW TO DO?)

My question is How to do the "HOW TO DO?" above.


原文:https://stackoverflow.com/questions/42117738
更新时间:2022-02-06 07:02

最满意答案

是本地代码汇编语言?

汇编语言是编写代码的一种方式, 汇编程序将汇编成机器代码,这就是写入可执行文件等的代码。 也就是说,汇编代码是人类的源代码,仅处于非常低的水平; 机器码是在该源代码上运行汇编程序的结果。 (这与您编写像C ++这样的更高级语言并使用编译器将编译为机器代码相似。)

jvm究竟做了什么,通过编码和解释为本地代码

可以编写JVM来解释字节码,但现代JVM不这么做; 他们有一个内置的即时编译器 (JIT),它可以获取字节码,并将其实时组装到机器代码中。 实际上,Sun的JVM有两阶段的JIT:一个阶段运行速度非常快(因此应用程序和类在运行时快速转换为机器代码,以避免启动延迟),另一个阶段是启动优化,它在代码中标识“热点”(代码运行很多)时使用(以便性能关键代码可以快速运行)。

所以现代JVM从.class文件中读取字节码,通过JIT运行它将其编译为机器码,并使计算机运行该机器码。 在这样做的时候,一个好的监测热点并积极地优化它们,创建更有效的新的替代机器代码。


is native code assembly language?

Assembly language is a way of writing code that will be assembled (by an assembler) into machine code, which is what is written to executable files and such. That is, assembly code is source code for humans, just at a very low level; machine code is the result of running an assembler on that source code. (This is analogous to when you write a higher-level language like C++ and compile it to machine code with a compiler.)

what does exactly jvm do takes bytycode and interpret to native code

A JVM could be written that just interpreted bytecode, but modern JVMs don't do that; they have a built-in Just-In-Time Compiler (JIT) which takes the bytecode and, effectively, assembles it on the-fly into machine code. In fact, Sun's JVM has a two-stage JIT: One stage that runs really quickly (so apps and classes get converted to machine code quickly when run, to avoid startup delays), and another stage it kicks in that does aggressive optimization, which it uses when it identifies "hot spots" (code that runs a lot) in the code (so that performance-critical code runs quickly).

So modern JVMs read bytecode from .class files, run it through the JIT to compile it to machine code, and have the computer run that machine code. While doing that, a good one monitors hot spots and aggressively optimizes them, creating new, replacement machine code that's more efficient.

相关问答

更多
  • 没有。 Java字节码是二进制编程语言,除非您考虑一堆数字可读,或者使用反汇编器将其反转为字节码文本助记符,或者最终将Java源形式本身反转,否则不是“可读形式”。 汇编通常是目标机器实际指令的文本助记符,彼此映射为1:1,因此汇编源代码中的一条指令将直接转换为一条机器代码指令(尽管某些CPU和汇编器存在一些例外,例如许多RISC汇编器会根据需要将“带有立即数的加载寄存器”翻译成多条指令 - 加载任何中间值,而本地机器代码只能加载特定位,并且必须由几条指令组成整个值)。 与大多数CPU机器码相比,Java字 ...
  • 那么JVM是否将字节码转换为它为(JVM)编写的本机代码? 不,不一定。 但是,现在默认情况下这样做是最先进的。 如果是这样,那不是不太安全吗? 安全性低于什么? 仅仅因为人们可以在机器代码中执行不安全的操作(例如解除引用单元化指针或访问未分配的内存)并不意味着JIT会生成这种不安全的代码。 究竟什么是即时编译器? 它是JVM的一部分,它将字节码转换为本机机器码。 名称“just in time”意味着代码在执行时被编译(在单独的线程中)。 完全编译后,JVM会注意到某些方法已编译并可在计算机级别调用。 S ...
  • 我也会推荐ASM,但是看看Jasmin ,我使用它(或者:不得不使用它)作为一个大学项目,它的效果很好,我写了一个词法分析器/解析器/分析器/优化器/生成器组合一个使用java和jasmin的程序语言,所以生成JVM代码。 我在这里上传了代码,有趣的部分应该是源代码本身 。 在文件夹“bytecode / InsanelyFastByteCodeCreator.java”中,您将找到一个将AST Tree转换为jasmin汇编器输入格式的代码。 很直截了当 源语言(由Lexer + Parser + Ana ...
  • 转贴为答案: 我不认为这种说法是正确的。 使用Java解释器的语言不是“JVM语言”,它只是一种解释语言。 IMO JVM语言(实际上是一个误称,它们是具有JVM实现的语言)是一个被编译为JVM字节码的语言 Reposted as answer: I don't think that statement is correct. A language with a Java interpreter is not a "JVM language", it's just an interpreted langua ...
  • RMI能够根据需要动态下载整个类文件定义 。 即使你不使用(或者不想使用)RMI,类加载的技术也许是有趣的,它们是标准的Java。 RMI has the ability to dynamically download entire class file definitions over the wire on demand. Even if you don't use (or want to use) RMI, the technologies underlying the classloading ma ...
  • 是本地代码汇编语言? 汇编语言是编写代码的一种方式, 汇编程序将汇编成机器代码,这就是写入可执行文件等的代码。 也就是说,汇编代码是人类的源代码,仅处于非常低的水平; 机器码是在该源代码上运行汇编程序的结果。 (这与您编写像C ++这样的更高级语言并使用编译器将其编译为机器代码相似。) jvm究竟做了什么,通过编码和解释为本地代码 可以编写JVM来解释字节码,但现代JVM不这么做; 他们有一个内置的即时编译器 (JIT),它可以获取字节码,并将其实时组装到机器代码中。 实际上,Sun的JVM有两阶段的JIT ...
  • 它更像是(在你的C层之后): Java program --> Java compiler --> bytecode --> JVM compiler --> assembly --> machine code --> ISA --> micro architecture (how the computer interprets ISA) --> logic gate --> circuit --> device 请注意,基本上有两个编译器。 这就是Java实现可移植性的方式。 It's more li ...
  • JVM字节码有点像汇编语言,但没有指针算术。 但是,它非常面向对象。 从积极的方面来说,它完全是跨平台的。 您可能需要查看LLVM字节码 - 但请记住以下警告: http : //llvm.org/docs/FAQ.html#can-i-compile-c-or-c-code-to-platform-independent- LLVM-位码 The JVM bytecode is sort of like assembly language, but without pointer arithmetic. ...
  • 理解JVM字节码需要一些时间。 为了让你在这里开始有两件事你需要知道: JVM是一个堆栈机器:当它需要评估表达式时,它首先将表达式的输入推入堆栈,然后评估表达式实质上是将所有输入从堆栈中弹出并将结果推回到堆栈顶部。 这个结果反过来可以被用作另一个表达式评估的输入。 所有参数和局部变量都存储在局部变量数组中。 让我们在实践中看到这一点。 这里是一个源代码: package p1; public class Movie { public void setPrice(int price) { thi ...
  • 在Java中,您不能有两个具有相同名称且仅与返回类型不同的方法 - Java Bytecode允许这样做 字节码允许在不调用构造函数的情况下创建类的实例 字节码允许直接使用GOTO,这在普通Java中是不允许的 更新:Simillar问题已在这里得到解答 In Java you cannot have two methods with the same names that differ only with return type - Java Bytecode allows to do that Byte ...

相关文章

更多

最新问答

更多
  • python的访问器方法有哪些
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。
  • 响应navi重叠h1和nav上的h1链接不起作用(Responsive navi overlaps h1 and navi links on h1 isn't working)
  • 在C中读取文件:“r”和“a +”标志的不同行为(Reading a File in C: different behavior for “r” and “a+” flags)
  • NFC提供什么样的带宽?(What Kind of Bandwidth does NFC Provide?)
  • 元素上的盒子阴影行为(box-shadow behaviour on elements)
  • Laravel检查是否存在记录(Laravel Checking If a Record Exists)
  • 设置base64图像的大小javascript - angularjs(set size of a base64 image javascript - angularjs)
  • 想学Linux 运维 深圳有哪个培训机构好一点
  • 为什么有时不需要在lambda中捕获一个常量变量?(Why is a const variable sometimes not required to be captured in a lambda?)
  • 在Framework 3.5中使用服务器标签<%=%>设置Visible属性(Set Visible property with server tag <%= %> in Framework 3.5)
  • AdoNetAppender中的log4net连接类型无效(log4net connection type invalid in AdoNetAppender)
  • 错误:发送后无法设置标题。(Error: Can't set headers after they are sent. authentication system)
  • 等待EC2实例重启(Wait for an EC2 instance to reboot)
  • 如何在红宝石中使用正则表达式?(How to do this in regex in ruby?)
  • 使用鼠标在OpenGL GLUT中绘制多边形(Draw a polygon in OpenGL GLUT with mouse)
  • 江民杀毒软件的KSysnon.sys模块是什么东西?
  • 处理器在传递到add_xpath()或add_value()时调用了什么顺序?(What order are processors called when passed into add_xpath() or add_value()?)
  • sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
  • 如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
  • AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
  • SQL查询,其中字段不包含$ x(SQL Query Where Field DOES NOT Contain $x)
  • PerSession与PerCall(PerSession vs. PerCall)
  • C#:有两个构造函数的对象:如何限制哪些属性设置在一起?(C#: Object having two constructors: how to limit which properties are set together?)
  • 平衡一个精灵(Balancing a sprite)
  • n2cms Asp.net在“文件”菜单上给出错误(文件管理器)(n2cms Asp.net give error on Files menu (File Manager))
  • Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
  • 湖北京山哪里有修平板计算机的