如何在不删除电子邮件的情况下删除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
最满意答案
是本地代码汇编语言?
汇编语言是编写代码的一种方式, 汇编程序将汇编成机器代码,这就是写入可执行文件等的代码。 也就是说,汇编代码是人类的源代码,仅处于非常低的水平; 机器码是在该源代码上运行汇编程序的结果。 (这与您编写像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:字节码混淆和JIT(JVM : Bytecode Confusion and JIT)[2021-12-31]
那么JVM是否将字节码转换为它为(JVM)编写的本机代码? 不,不一定。 但是,现在默认情况下这样做是最先进的。 如果是这样,那不是不太安全吗? 安全性低于什么? 仅仅因为人们可以在机器代码中执行不安全的操作(例如解除引用单元化指针或访问未分配的内存)并不意味着JIT会生成这种不安全的代码。 究竟什么是即时编译器? 它是JVM的一部分,它将字节码转换为本机机器码。 名称“just in time”意味着代码在执行时被编译(在单独的线程中)。 完全编译后,JVM会注意到某些方法已编译并可在计算机级别调用。 S ... -
创建一个JVM编程语言(Create a JVM programming language)[2022-12-13]
我也会推荐ASM,但是看看Jasmin ,我使用它(或者:不得不使用它)作为一个大学项目,它的效果很好,我写了一个词法分析器/解析器/分析器/优化器/生成器组合一个使用java和jasmin的程序语言,所以生成JVM代码。 我在这里上传了代码,有趣的部分应该是源代码本身 。 在文件夹“bytecode / InsanelyFastByteCodeCreator.java”中,您将找到一个将AST Tree转换为jasmin汇编器输入格式的代码。 很直截了当 源语言(由Lexer + Parser + Ana ... -
解释哪些JVM语言而不是编译为字节码?(Which JVM languages are interpreted rather than compiled to bytecode?)[2022-07-28]
转贴为答案: 我不认为这种说法是正确的。 使用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 ...
-
统一汇编语言(Unified assembly language)[2022-06-15]
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 ...
-
JVM:无法使用普通Java构建的字节码构造示例?(JVM: Example of Bytecode construct that cannot be built using plain Java?)[2021-08-26]
在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 ...