You are previewing Sams Teach Yourself Java in 21 Days, Sixth Edition.

Sams Teach Yourself Java in 21 Days, Sixth Edition

Cover of Sams Teach Yourself Java in 21 Days, Sixth Edition by Rogers Cadenhead Published by Sams
O'Reilly logo

Day 17. Communicating Across the Internet

Java was developed initially as a language that would control a network of interactive consumer devices. Connecting machines was one of the main purposes of the language when it was designed, and that remains true today.

The java.net package makes it possible to communicate over a network, providing cross-platform abstractions to make connections, transfer files using common web protocols, and create sockets.

Used in conjunction with input and output streams, reading and writing files over the network becomes as easy as reading or writing files on disk.

The java.nio package expands Java’s input and output classes.

Today, you write networking Java programs that do each of the following:

• Load a document ...

The best content for your career. Discover unlimited learning on demand for around $1/day.