Book description
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 largecategories: 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 automaticallycompressing 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, 2nd Edition includes:
- Coverage of all I/O classes and related classes
- In-depth coverage of Java's number formatting facilities and its support for international character sets
Publisher resources
Table of contents
- Preface
- I. Basic I/O
- II. Data Sources
-
III. Filter Streams
- 6. Filter Streams
- 7. Print Streams
- 8. Data Streams
- 9. Streams in Memory
-
10. Compressing Streams
- Inflaters and Deflaters
- Compressing and Decompressing Streams
-
Zip Files
- Zip Entries
-
The ZipOutputStream Class
- Constructing and initializing the ZipOutputStream
- Set the comment for the zip file
- Set the default compression level and method
- Construct a ZipEntry object and put it in the archive
- Write the entry’s data onto the output stream
- Close the zip entry
- Finish the zip output stream
- Close the zip output stream
- An example
- The ZipInputStream Class
- Checksums
- File Viewer, Part 4
- 11. JAR Archives
- 12. Cryptographic Streams
- 13. Object Serialization
-
IV. New I/O
- 14. Buffers
- 15. Channels
- 16. Nonblocking I/O
-
V. The File System
-
17. Working with Files
- Understanding Files
- Directories and Paths
- The File Class
- Filename Filters
- File Filters
- File Descriptors
- Random-Access Files
- General Techniques for Cross-Platform File Access Code
- 18. File Dialogs and Choosers
-
17. Working with Files
-
VI. Text
- 19. Character Sets and Unicode
-
20. Readers and Writers
- The java.io.Writer Class
- The OutputStreamWriter Class
- The java.io.Reader Class
- The InputStreamReader Class
- Encoding Heuristics
- Character Array Readers and Writers
- String Readers and Writers
- Reading and Writing Files
- Buffered Readers and Writers
- Print Writers
- Piped Readers and Writers
- Filtered Readers and Writers
- File Viewer Finis
- 21. Formatted I/O with java.text
-
VII. Devices
- 22. The Java Communications API
- 23. USB
- 24. The J2ME Generic Connection Framework
- 25. Bluetooth
- VIII. Appendix
- Index
- About the Author
- Colophon
- Copyright
Product information
- Title: Java I/O, 2nd Edition
- Author(s):
- Release date: May 2006
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596527501
You might also like
book
Java I/O
All of Java's Input/Output (I/O) facilities are based on streams, which provide simple ways to read …
book
Java I/O, NIO and NIO.2
Java I/O, NIO, and NIO.2 is a power-packed book that accelerates your mastery of Java's various …
book
Java NIO
Many serious Java programmers, especially enterprise Java programmers, consider the new I/O API--called NIO for New …
video
Design Patterns in Java
Design Patterns in Java LiveLessons is a clear, concise introduction to one of the most important …