
Java I/O
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Intro
- Table of Contents
- Preface
- What's New in This Edition
- Organization of the Book
- Part I: Basic I/O
- Part II: Data Sources
- Part III: Filter Streams
- Part IV: New I/O
- Part V: The File System
- Part VI: Text
- Part VII: Devices
- Who You Are
- About the Examples
- Conventions Used in This Book
- Request for Comments
- Safari Enabled
- Acknowledgments
- Part I
- Introducing I/O
- What Is a Stream?
- Where Do Streams Come From?
- The Stream Classes
- Numeric Data
- Integer Data
- Conversions and Casts
- Character Data
- ASCII
- Latin-1
- Unicode
- Other Encodings
- The char Data Type
- Readers and Writers
- Buffers and Channels
- The Ubiquitous IOException
- The Console: System.out, System.in, and System.err
- System.out
- System.err
- System.in
- Redirecting System.out, System.in, and System.err
- The Console Class // Java 6
- Security Checks on I/O
- Output Streams
- Writing Bytes to Output Streams
- Writing Arrays of Bytes
- Closing Output Streams
- The Closeable Interface
- Flushing Output Streams
- The Flushable Interface
- Subclassing OutputStream
- A Graphical User Interface for Output Streams
- Input Streams
- The read( ) Method
- Reading Chunks of Data from a Stream
- Counting the Available Bytes
- Skipping Bytes
- Closing Input Streams
- Marking and Resetting
- Subclassing InputStream
- An Efficient Stream Copier
- Part II
- File Streams
- Reading Files
- Writing Files
- File Viewer, Part 1
- Network Streams
- URLs
- URL Connections
- Reading Data from URL Connections
- Writing Data on URL Connections
- Sockets
- Server Sockets
- URLViewer
- Part III
- Filter Streams
- The Filter Stream Classes
- The Filter Stream Subclasses
- Buffered Streams
- BufferedInputStream Details
- BufferedOutputStream Details
- PushbackInputStream
- ProgressMonitorInputStream
- Multitarget Output Streams
- File Viewer, Part 2
- Print Streams
- Print Versus Write
- Line Breaks
- Error Handling
- printf( )
- Formatter
- Constructors
- Character Sets
- Locales
- Error Handling
- Format Specifiers
- Integer conversions
- Floating-point conversions
- Date and time conversions
- Character conversions
- Boolean conversions
- General conversions
- Format Modifiers
- Argument index
- Flags
- Width
- Precision
- Formattable
- Data Streams
- The Data Stream Classes
- The DataInput and DataOutput Interfaces
- Constructors
- Integers
- Integer Formats
- The Char Format
- Writing Integers
- Reading Integers
- Floating-Point Numbers
- Writing Floating-Point Numbers
- Reading Floating-Point Numbers
- Booleans
- Byte Arrays
- Determining the Number of Bytes Written
- Skipping Bytes
- Strings and chars
- Writing Text
- Reading Text
- The Deprecated readLine( ) Method
- Little-Endian Numbers
- Thread Safety
- File Viewer, Part 3
- Streams in Memory
- Sequence Input Streams
- Byte Array Streams
- Byte Array Input Streams
- Byte Array Output Streams
- Communicating Between Threads Using Piped Streams
- Compressing Streams
- Inflaters and Deflaters
- Deflating Data
- Constructing deflaters
- Choose a strategy
- Set the compression level
- Set the dictionary
- Set the input
- Deflate the data repeatedly until needsInput( ) returns true
- Finish the deflation
- Reset the deflater and start over
- An example
- Checking the state of a deflater
- Inflating Data
- Constructing inflaters
- Set the input
- Check whether a preset dictionary was used
- Set the dictionary
- Inflate the data
- Reset the inflater
- An example
- Checking the state of an inflater
- Compressing and Decompressing Streams
- The DeflaterOutputStream Class
- The InflaterInputStream Class
- The GZIPOutputStream Class
- The GZIPInputStream Class
- Expanding Output Streams and Compressing Input 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
- Construct a ZipInputStream
- Open the next zip entry
- Reading from a ZipInputStream
- Close the zip entry
- Close the ZipInputStream
- An example
- Checksums
- Checked Streams
- File Viewer, Part 4
- JAR Archives
- Meta-Information: Manifest Files and Signatures
- The jar Tool
- The java.util.jar Package
- JarFile
- JarEntry
- Attributes
- Manifest
- JarInputStream
- JarOutputStream
- JarURLConnection
- Pack200
- Reading Resources from JAR Files
- Cryptographic Streams
- Hash Functions
- Requirements for Hash Functions
- The MessageDigest Class
- Calculating Message Digests
- Creating Message Digests
- Feeding Data to the Digest
- Finishing the Digest
- Reusing Digests
- Comparing Digests
- Accessor Methods
- Digest Streams
- DigestInputStream
- DigestOutputStream
- Encryption Basics
- Keys
- Secret Key Versus Public Key Algorithms
- Block Versus Stream Ciphers
- Key Management
- The Cipher Class
- init( )
- Mode
- Key
- Algorithm parameters
- Source of randomness
- update( )
- doFinal( )
- Accessor Methods
- Cipher Streams
- CipherInputStream
- CipherOutputStream
- File Viewer, Part 5
- Object Serialization
- Reading and Writing Objects
- Object Streams
- How Object Serialization Works
- Performance
- The Serializable Interface
- Classes That Implement Serializable but Aren't
- Problem 1: References to nonserializable objects
- Problem 2: Missing a no-argument constructor in superclass
- Problem 3: Deliberate throwing of NotSerializableException
- Locating the offending object
- Making nonserializable fields transient
- Versioning
- Compatible and Incompatible Changes
- SUIDs
- Customizing the Serialization Format
- The readObject( ) and writeObject( ) Methods
- The defaultWriteObject() and defaultReadObject( ) Methods
- The writeReplace( ) Method
- The readResolve( ) Method
- serialPersistentFields
- Preventing Serialization
- Externalizable
- Resolving Classes
- Resolving Objects
- Validation
- Sealed Objects
- JavaDoc
- @serial
- @serialData
- @serialField
- Part IV
- Buffers
- Copying Files with Buffers
- Creating Buffers
- Buffer Layout
- Limit
- Bulk Put and Get
- Absolute Put and Get
- Mark and Reset
- Compaction
- Duplication
- Slicing
- Typed Data
- View Buffers
- Put Type Methods
- Byte Order
- Read-Only Buffers
- CharBuffers
- Memory-Mapped I/O
- Creating Mapped Byte Buffers
- MappedByteBuffer Methods
- Channels
- The Channel Interfaces
- Channel
- ReadableByteChannel and WritableByteChannel
- ByteChannel
- Exceptions
- Gathering and Scattering Channels
- File Channels
- Transferring Data
- Random Access
- Threading and Locking
- FileLock
- Flushing
- Converting Between Streams and Channels
- Converting Channels to Streams
- Converting Streams to Channels
- Converting Channels to Readers and Writers
- Socket Channels
- Server Socket Channels
- Datagram Channels
- Connecting
- Reading
- Writing
- Nonblocking I/O
- Nonblocking I/O
- Selectable Channels
- Selectors
- Selection Keys
- Getters
- Attachments
- Canceling
- Pipe Channels
- Part V
- Working with Files
- Understanding Files
- Filenames
- File Attributes
- Filename Extensions and File Types
- Directories and Paths
- Paths and Separators
- Relative versus Absolute Paths
- Absolute paths
- Relative paths
- The File Class
- Constructing File Objects
- Listing the Roots
- Listing Information about a File
- Does the file exist? Is it a normal file? Is it a directory?
- Filename and path
- Absolute paths
- Canonical paths
- Parents
- File attributes
- An example
- Manipulating Files
- Creating files
- Moving and renaming files
- Deleting files
- Changing file attributes
- Temporary Files
- Checking for Free Space/Java 6
- Directories
- Creating directories
- Listing directories
- The listFiles( ) methods
- File URLs
- Filename Filters
- File Filters
- File Descriptors
- Random-Access Files
- General Techniques for Cross-Platform File Access Code
- File Dialogs and Choosers
- File Dialogs
- JFileChooser
- Constructing File Choosers
- Displaying File Choosers
- Getting the User's Selection
- Manipulating the JFileChooser
- Custom Dialogs
- Filters
- Selecting Directories
- Multiple Selections
- Hidden Files
- File Views
- FileSystem Views
- Handling Events
- Action events
- Property change events
- Accessory
- File Viewer, Part 6
- Part VI
- Character Sets and Unicode
- The Unicode Character Set
- UTF-16
- UTF-8
- Other Encodings
- Converting Between Byte Arrays and Strings
- The String Class
- The Charset Class
- Retrieving Charset objects
- Character set info
- Encoding and decoding
- CharsetEncoder and CharsetDecoder
- Encoding
- Decoding
- Error handling
- Measurement
- Encodability
- 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
- The CharArrayWriter Class
- The CharArrayReader Class
- String Readers and Writers
- String Writers
- String Readers
- Reading and Writing Files
- FileWriter
- FileReader
- Buffered Readers and Writers
- Buffering Writes
- Buffering Reads
- Line Numbering
- Print Writers
- Piped Readers and Writers
- Filtered Readers and Writers
- The FilterReader Class
- The FilterWriter Class
- PushbackReader
- File Viewer Finis
- Formatted I/O with java.text
- The Old Way
- Choosing a Locale
- Number Formats
- Formatting Numbers
- Specifying Precision
- Grouping
- Currency Formats
- Percent Formats
- Specifying Width with FieldPosition
- Parsing Input
- Decimal Formats
- Decimal Format Patterns
- DecimalFormatSymbols
- Constructing Decimal Formats with Patterns and Symbols
- Part VII
- The Java Communications API
- The Architecture of the Java Communications API
- Identifying Ports
- Finding the Ports
- Getting Information about a Port
- Opening Ports
- Communicating with a Device on a Port
- Communicating with a Port
- Port Properties
- Serial Ports
- Control Functions
- Flow Control
- Control Wires
- DTR
- RTS
- CTS
- DSR
- RI
- CD
- Serial Port Events
- SerialPortEventListener
- SerialPortEvent
- Parallel Ports
- Parallel Port Modes
- Controlling the Parallel Port
- Checking the State of the Port
- Parallel Port Events
- Parallel Port Event Listeners
- ParallelPortEvent
- USB
- USB Architecture
- Finding Devices
- Controlling Devices
- Describing Devices
- UsbDevice
- UsbDeviceDescriptor
- USB Configurations
- UsbConfigurationDescriptor
- UsbInterface
- Settings
- Claiming
- UsbInterfaceDescriptor
- UsbEndpoints
- Pipes
- IRPs
- Temperature Sensor Example
- Hot Plugging
- The J2ME Generic Connection Framework
- The Generic Connection Framework
- The Connector Class
- ContentConnection
- Files
- File attributes
- Listing directories
- Filesystem Listeners
- HTTP
- Getter Methods
- Configuring the HTTP Request Header
- Reading the HTTP Response Header
- Serial I/O
- Sockets
- Getters
- Socket Options
- Server Sockets
- Datagrams
- Datagram URLs
- Bluetooth
- The Bluetooth Protocol
- The Java Bluetooth API
- UUIDs
- The Bluetooth Control Center
- Initialization
- The Local Device
- Properties
- Device Class
- Discoverability
- Discovering Devices
- Remote Devices
- Service Records
- The DataElement Class
- Finding Service Records
- The ServiceRecord Interface
- Talking to Devices
- RFCOMM Clients
- L2CAP Devices
- Part VIII
- Character Sets
- Index
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.