天天看點

Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結:

Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結:
Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結:
Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結:

在執行個體化zipentry的時候,要設定名稱,此名稱實際上就是壓縮檔案中的每一個元素的名稱。

Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結:
Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結:

以上的操作隻是完成了一個檔案的壓縮,如果要完成一個檔案夾的壓縮呢?

Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結:
Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結:

zipfile在執行個體化的時候必須接收file類的執行個體,此file類的執行個體是指向一個壓縮的*.zip檔案。

為zipfile執行個體化:

通過zipfile檔案,為mldn.zip進行解壓縮操作。

以上的操作操作中,有一個問題,必須知道壓縮檔案中的每一個壓縮執行個體的名稱才可以進行解壓縮操作,而如果現在假設是一個檔案夾呢?

定義:

Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結:
Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結:
Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結:
Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結:
Java IO--壓縮流ZipOutputStream/ZipInputStream壓縮流:壓縮流的實作:zipEntry:ZipOutputStream:壓縮一個檔案夾:ZipFile:ZipInputStream:總結: