Thinking in java 4th Edition 读书笔记-I/O(5)

1.For each file to add to the archive, you must call putNextEntry( ) and pass it a ZipEntry object. The ZipEntry object contains an extensive interface that allows you to get and set all the data available on that particular entry in your Zip file: name, compressed and uncompressed sizes, date, CRC checksum, extra field data, comment, compression method, and whether it's a directory entry.


2.the Zip format has a way to set a password, this is not supported in Java's Zip library. And although CheckedInputStream and CheckedOutputStream support both Adler32 and CRC32 checksums, the ZipEntry class supports only an interface for CRC.


3.The jar tool isn't as general-purpose as a Zip utility.a JAR file created on one platform will be transparently readable by the jar tool on any other platform.


4.It would be incredibly useful if an object could exist and hold its information even while the program wasn't running.Java's object serialization allows you to take any object that implements the Serializable interface and turn it into a sequence of bytes that can later be fully restored to regenerate the original object.


5.The serialization mechanism automatically compensates for differences in operating systems.That is, you can create an object on a Windows machine, serialize it, and send it across the network to a Unix machine, where it will be correctly reconstructed.


6.The serialization mechanism is lightweight,because you can't simply define an object using some kind of "persistent" keyword and let the system take care of the details.While, If you need a more serious persistence mechanism, consider a tool like Hibernate.


7.Object serialization was added to the language to support two major features. First, it's for Java's Remote Method Invocation (RMI).Object serialization is also necessary for JavaBeans.


8.particularly clever aspect of object serialization is that it not only saves an image of your object, but it also follows all the references contained in your object and saves those objects, and follows all the references in each of those objects.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值