[英]JVM behaviour on the object of a class implement serializable interface
我的问题是,当我们拥有实现接口可序列化的类时,当我们通过网络发送该类的对象时,JVM是否将对象的副本复制到内存中,或者JVM如何通过“保持对象的状态”的含义进行行为。
interface serializable is a marker interface, it indicate to JVM that objects of this class (which implements serialized) can be persisted to any stream (file or pushed on network socket). interface serializable接口是标记接口,它向JVM指示可以将此类的对象(实现序列化)持久化到任何流(文件或在网络套接字上推送)。 Whenever asked for serialization JVM writes the state of that object on the given stream and original object is kept or discarded will depend of the scope (life) of that object;
每当要求进行序列化时,JVM都会在给定的流上写入该对象的状态,而原始对象的保留或丢弃将取决于该对象的范围(生存期)。 so no question of JVM making making copy in memory or not.
因此,毫无疑问,JVM是否在内存中进行复制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.