Java 8 Fundamentals: Input/Output
Java I/O is one of the four core APIs of the JDK, on which many others are built, including Database access, Web Services, and REST Services. In this course, you'll learn everything you need to write and understand Java I/O code.
What you'll learn
The Java I/O API is a fundamental API of the JDK, at the basis of database access APIs and Web access APIs. In this course, Java 8 Fundamentals: Input/Output, you'll learn all the details of this API, both the theoretical aspects on slides and the patterns during extended live coding sessions. First, you'll delve into code in action, showing you real life problem solving techniques. Next, you'll explore how to read and write characters, how to create complex files mixing text and raw bytes, and how to create archive files using the ZIP format. Finally, you'll discover how to use serialization efficiently and how to deal with errors due to obsolete serialized objects. By the end of this course, you'll have the necessary knowledge to deal with complex Java I/O problems in existing legacy applications and new developments.
Table of contents
- Version Check 0m
- Introducing Input/Output APIs: What Are You Going to Learn? 2m
- What Do You Need to Know to Follow This Course? 1m
- Agenda and Organization of This Course 2m
- Introducing Java I/O: Organization, Main Classes, File, and Path 2m
- Modeling Disk Files and Paths with the File and Path Objects 2m
- Understanding the Path to a File Using the File Object 3m
- Introducing the Path Interface from Java 7 2m
- Understanding the Path Object, Resolving and Relativizing Paths 3m
- Wrapping up Path Relativization 1m
- Module Wrap-up 1m
- Introducing the Module: Different Ways of Reading Characters 1m
- Introducing Readers and the Basic Operations Defined 1m
- Understanding How to Read Characters Using a Reader 3m
- Dealing with Exceptions When Reading Characters from a Reader 3m
- Closing a Reader 4m
- Opening and Closing Readers Using the Try-with-resources Pattern 2m
- Introducing the Marking, Resetting, and Skipping Operations 2m
- Creating Readers for Disk and in-memory Operations 2m
- Understanding the Decorator Pattern Used in the Java I/O API 5m
- Java 7 Patterns to Create Readers with Specific Charsets 2m
- Understanding Read and Close Operations on Decorated Readers 1m
- Live Coding: File Creation ad File Operations 4m
- Live Coding: Reading a File Line by Line Using a BufferedReader 4m
- Live Coding: Improving the Pattern Using the Java 8 Stream API 3m
- Wrap-up 1m
- Introducing the Module: Different Ways of Writing Characters 1m
- Introducing Writers and the Basic Operations Defined 1m
- Understanding How to Write Characters and Arrays of Chars 1m
- Dealing with Exceptions When Writing Characters Using a Writer 1m
- Introducing the Writers to Write to Disk or in-memory Arrays 1m
- Understanding How to Create Writers Using the Decorator Pattern 2m
- Wrapping up the Decorator Pattern for the Writer Class 1m
- Using Factory Methods to Use Specific Charsets and Open Options 2m
- Understanding the Flush Operation for Writers 2m
- Printing with a Sprintf Format Using the PrintWriter Object 1m
- Live Coding: Simple Writing to a Text File 4m
- Live Coding: Using the Printwriter Object to Print with a Format 2m
- Live Coding: Formatting Dates Using the Print with Format Pattern 3m
- Wrap-up 1m
- Introducing the Module: Reading and Writing Bytes Operations 1m
- Introducing Binary Streams, InputStream, and OutputStream Classes 2m
- Reading and Writing Through InputStream and OutputStream 2m
- Dealing with Exceptions with InputStream and OutputStream 1m
- Concrete Implementations of InputStream and OutputStream 1m
- Reading and Writing Primitive Types with Data I/O Streams 3m
- Understanding the in-memory Byte Array Streams 2m
- Creating a GZip Stream Using the Decorator Pattern 3m
- Creating and Reading an Archive ZIP Stream with Complex Content 4m
- Live Coding: Writing Primitive Types to a File 5m
- Live Coding: Writing UTF Strings to Bytes Files 2m
- Live Coding: Writing Ints to Bytes Files with a DataOutputStream 2m
- Live Coding: Writing Ints to a File Compressed with GZip 4m
- Live Coding: Reading Back Ints with a DataInputStream 4m
- Live Coding: Reading Back Ints from a GZip Compressed File 2m
- Live Coding: Creating an Archive File with the ZipOutputStream 4m
- Live Coding: Reading an Archive File with the ZipInputStream 4m
- Wrap-up 1m
- Introducing the Module: Reading and Writing Objects 1m
- Understanding the Portable Serialization of Objects 4m
- Introducing the Serialization Mechanism in the JDK 1m
- What Information Do You Need in a Serialized Form of an Object? 3m
- Making a Class Serializable, Understanding the SerialVersionUID 3m
- Computing the SerialVersionUID of a Class 2m
- Understanding the Deserialization Process 3m
- Wrapping up the Serialization/deserialization Mechanism 1m
- Writing and Reading Serialized Objects to Binary Streams 2m
- Making Relations Transient to Prevent Serialization 2m
- Using ReadObject/WriteObject to Override Default Serialization 4m
- Wrapping up the ReadObject/WriteObject Methods 1m
- Using Externalizable to Serialize Objects Identity 3m
- Serializing Proxy Objects Instead of the Serializable Object 2m
- Wrapping up Serialization with Proxy Objects 1m
- Wrapping up the 3 Ways of Overriding the Default Serialization 1m
- Live Coding: Introducing Serialization and the Serialized File 4m
- Live Coding: Making a String Field Transient 1m
- Live Coding: Serializing a List of Serializable Objects 1m
- Live Coding: Serializing Person Objects Using WriteObject 2m
- Live Coding: Serializing Person Objects Using Externalizable 2m
- Live Coding: Serializing Person Objects Using a Proxy Class 3m
- Live Coding: Deserializing a List of Person Objects 2m
- Live Coding: Deserializing Person Objects Using ReadObject 4m
- Live Coding: Deserializing Externalized Person Objects 2m
- Live Coding: Deserializing Person Objects Serialized with a Proxy 3m
- Wrap-up 1m
- Introducing the Module: Hybrid Streams of Text and Bytes 1m
- Introducing Hybrid Streams 2m
- Creating Readers and Writers by Decorating Binary Streams 2m
- Introducing the InputStreamReader and OutputStreamWriter Classes 1m
- Introducing the Aesop's Fables Use Case Study 2m
- Live Coding: Setting up the Project for Use Case Study 3m
- Live Coding: Setting up a Formatter to Write the Header 2m
- Live Coding: Writing the Text Header of the Aesop's Fables File 3m
- Live Coding: Writing and Compressing the Text of Each Fable 2m
- Live Coding: Concatenating the Compressed Texts 2m
- Live Coding: Creating the Correct Header with Offset and Length 1m
- Live Coding: Putting the Pieces Together in the Final File 2m
- Live Coding: Reading Back a Given Fable from the List 4m
- Live Coding: Understanding Mark, Reset, and Skip 4m
- Live Coding: Reading and Unzipping the Fable Text 3m
- Live Coding: Wrapping up the Aesop's Fable Use Case Study 1m
- Introducing Sockets to Communicate Data Through a Network 3m
- Live Coding: Introducing the Client/server Use Case Study 1m
- Live Coding: Setting up a Server That Sends a Text Message 4m
- Live Coding: Setting up a Client to Communicate with the Server 4m
- Wrapping up the Client/server Case Study 1m
- Course Wrap-up 3m