Giter VIP home page Giter VIP logo

Comments (3)

zengjingfang avatar zengjingfang commented on September 21, 2024

Serializable

  • 序列化 Object > ObjectOutputStream.writeObject
  • 反序列化 ObjectInputStream.readObject > Object
  • serialVersionUID
    + 标识一个系列化的类,序列化时一起写到文件中,反序列化时验证这个ID,不相同则失败
    + 保障了在进行版本升级的过程中对类的成员进行了修改,避免崩溃
  • 不参与序列化的
    + static的静态变量
    + transient关键字标记的成员变量

from androidbox.

zengjingfang avatar zengjingfang commented on September 21, 2024

Parcelabel

from androidbox.

zengjingfang avatar zengjingfang commented on September 21, 2024

区别

  • Serializable
    + 使用简单方便
    + 要进行I/O操作,开销大
  • Parcelable
    + 为android而生,性能好
    + 主要在主内存上序列化,是为了在组件间能够快速的传递数据

from androidbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.