Java I/O, 2/e (Paperback)

Elliotte Rusty Harold

  • 出版商: O'Reilly
  • 出版日期: 2006-06-20
  • 定價: $1,980
  • 售價: 9.5$1,881
  • 貴賓價: 9.0$1,782
  • 語言: 英文
  • 頁數: 726
  • 裝訂: Paperback
  • ISBN: 0596527500
  • ISBN-13: 9780596527501
  • 相關分類: Java 程式語言
  • 立即出貨 (庫存 < 3)




All of Java's Input/Output (I/O) facilities are based on streams, which provide simple ways to read and write data of different types. Java provides many different kinds of streams, each with its own application. The universe of streams is divided into four large categories: input streams and output streams, for reading and writing binary data; and readers and writers, for reading and writing textual (character) data. You're almost certainly familiar with the basic kinds of streams--but did you know that there's a CipherInputStream for reading encrypted data? And a ZipOutputStream for automatically compressing data? Do you know how to use buffered streams effectively to make your I/O operations more efficient? Java I/O, 2nd Edition has been updated for Java 5.0 APIs and tells you all you ever need to know about streams--and probably more.

A discussion of I/O wouldn't be complete without treatment of character sets and formatting. Java supports the Unicode standard, which provides definitions for the character sets of most written languages. Consequently, Java is the first programming language that lets you do I/O in virtually any language. Java also provides a sophisticated model for formatting textual and numeric data. Java I/O, 2nd Edition shows you how to control number formatting, use characters aside from the standard (but outdated) ASCII character set, and get a head start on writing truly multilingual software.



Java的所有輸入/輸出(I/O)功能都是基於流(streams)的,它提供了簡單的方法來讀寫不同類型的數據。Java提供了許多不同種類的流,每種流都有自己的應用。流的世界分為四個大類:用於讀寫二進制數據的輸入流和輸出流,以及用於讀寫文本(字符)數據的讀取器和寫入器。您幾乎肯定熟悉基本類型的流,但您知道有一個用於讀取加密數據的CipherInputStream嗎?還有一個用於自動壓縮數據的ZipOutputStream嗎?您知道如何有效地使用緩衝流來使您的I/O操作更高效嗎?《Java I/O》第2版已經更新為Java 5.0 API,並告訴您關於流的一切,可能還有更多。

討論I/O時,不完整的內容是不完整的,需要處理字符集和格式。Java支持Unicode標準,該標準為大多數書面語言的字符集提供了定義。因此,Java是第一種可以在幾乎任何語言中進行I/O的編程語言。Java還提供了一個用於格式化文本和數字數據的複雜模型。《Java I/O》第2版向您展示如何控制數字格式,使用除了標準(但已過時)ASCII字符集之外的字符,並為編寫真正多語言軟件提供一個快速入門。