- Shopping Bag ( 0 items )
Ships from: Chatham, NJ
Usually ships in 1-2 business days
A complete treatment of network programming and cryptography in Java.
This book is the updated second edition of the popular Java Network Programming. It covers new network related features found in the Java 2 Platform, and information on related technologies, such as streaming. This is one of the best books on this subject to date. To get the most benefit from this publication, you should know Java and be familiar with the APIs. It will also help if you're familiar with basic networking, CORBA and RMI.
In this chapter, we first discuss the characteristics of streams, then move on to the two generic stream classes: OutputStream and Inputstream. These are the superclasses of all other streams. The methods of these classes are detailed, then demonstrated with examples. A brief discussion of the basic stream types supplied by the API concludes the chapter. We will look at all of these streams in detail in later chapters.
Figure 5.1 OutputStream and InputStream
The communications channel usually connects an output stream to a corresponding input stream. Everything that is written to the output stream can subsequently be read from the input stream. This connection can take the form of a link through a network, a memory buffer between threads, a file, or a terminal to the user. Streams provide a uniform data interface for applications, no matter what communications channel is actually used.
All of the I/O classes in Java are supplied by the package java.io.
In cases where we wish to both write to and read from a single communications channel, we must use one stream to write (the output stream) and a different stream to read (the input stream). As we will see later when we look at networking applications, when you open a network connection, you obtain two streams--an input stream to read from the network and an output stream to write to the network.
Blocking refers to a thread going to sleep because it attempts to read data and there is none available, or it attempts to write data and the operation does not happen immediately. The Java environment will let other threads run while one is blocking; the blocking thread will wake up only when data arrive or the I/O operation completes.
There is little facility for nonblocking I/O in Java. Nonblocking I/O refers to being able to read some data and return immediately if there is none available, or to write some data and to return immediately if there will be a delay. We will look at the existing nonblocking facilities when we start building network servers.
Figure 5.2 Reader and Writer
For all text-based communications, use of the character streams is recommended. General-purpose conversion classes are available that interface between byte streams and character streams. These can be used to interface to non-Unicode systems, such as native files and network streams. The generalized nature of these conversion classes allows text to be easily converted from Unicode to ASCII, ISO Latin 1, dingbats, or other appropriate byte encoding.
The character streams are covered in detail in chapters 10, 11, and 12. For the purposes of the following chapters, which provide examples that read text from the keyboard and write to the terminal, we will ignore issues of character conversion and consider input and output as consisting just of bytes.
Obviously, with Java's inheritance model, if you create a FileOutputstream, then you can subsequently pass it as just a generic Outputstream...
|preface to the second edition|
|preface to the first edition|
|guide to the reader|
|about the cover illustration|
|1||Introduction to networking||3|
|2||The Java security model||17|
|3||An overview of exceptions||27|
|4||An overview of multithreading||35|
|5||An introduction to streams||61|
|6||File access through streams||79|
|7||Extending streams with filters||101|
|8||Supplied stream filters||119|
|9||Memory I/O streams||147|
|11||Character stream filters||181|
|12||Memory-based character streams||203|
|15||Some example TCP/IP clients||273|
|17||Building a Web server||325|
|18||Client/server Internet applications||361|
|19||The URL classes||401|
|21||Some datagram applications||459|
|Pt. IV||Alternative Technologies|
|23||Remote method invocation||499|
|24||RMI in practice||535|
|27||Servlets in practice||629|
|Pt. V||Message streams|
|29||Queuing message streams||677|
|30||Multiplexing message streams||687|
|31||Routing message streams||709|
|32||A generic message server||719|
|33||Building a generic client||731|
|App. B Tables||775|
As before, our main reason for writing Java Network Programming is to provide you with useful techniques and code for networked applications development in Java.
With the recent updates to the Java platform, its capabilities for networking and distributed computing have expanded significantly. APIs now exist that offer new options for significant applications development
. The primary focus of this book is the fundamental networking technology provided by Java: streams and IP-based protocols such as TCP, UDP, and multicast. In this second edition we have added coverage of new API features relevant to these technologies, while, in addition, improving and extending the examples provided by the first edition to cover these changes and more.
In other areas, updates to the Java platform have introduced new networking capabilities such as RMI, CORBA, and servlets. To provide a good networking foundation in this book, we have added coverage of these important topics to the second edition. Of course, spatial limitations of the printed page limit the depth in which we can cover these specialized networking APIs. As a result we have attempted to introduce these topics sufficiently that you can make an informed choice about what technology to use, and should one catch your fancy, other dedicated books can serve you better than we could hope to.
Finally, with the Java 2 platform, a complete and far-reaching cryptography API has been added to Java's repertoire. Rather than attempting to shoehorn our cryptographic examples from the first edition into this new API, we have completely excised cryptography from this secondedition, preferring to cover that in a separate book, Applied Java Cryptography , due out after the Java APIs stabilize. In short, there was a lot of new stuff that needed coverage, some old stuff that needed revision, and then some other random things that happened to catch our attention. Plus, our publisher put a gun to our head so we didn't have any choice.
Posted January 21, 2000
<i>Java Network Programming, Second Edition </i>aims is the sequel to the highly popular Java Network Programming title, and picks up where the original left off. It offers considerably expanded coverage of the Java networking API, for the Java 2 platform. The authors build on chapters from the previous book, adding Java 2 specific methods and classes, and covering newer topics such as servlets, and CORBA (support for which was introduced in the Java 2 platform). <p>Readers unfamiliar with network programming, and the intricacies of sockets, are guided fairly gently through the process, with a thorough coverage of I/O streams (including files), UDP and TCP sockets, from both client and server perspective. This gives a good grounding for later development, with plenty of example clients and servers. There's also coverage of Java HTTP support, which is quite simple to work through.</p> <p>That said, readers familiar with the original title may be in for some disappointment. The strong cryptography coverage of the first book has vanished, mentioned only in the preface as the subject of a future book. Not being very cryptographically minded myself, I really enjoyed reading about this topic in the first title. Nonetheless, with the number of pages in this thick reference, something probably had to go, to save room for other topics.</p> <p>Newer topics covered in the second edition (or greatly enhanced from coverage in the first edition) include servlets, CORBA, and remote method invocation (RMI). There's even more examples than in the first edition, but there are a few gaps where coverage could have been improved (for example, the new RMI activation features are barely mentioned, and the reader is referred instead to the RMI documentation of Sun). Servlet coverage could really be improved as well - there's some great books out on the market though that can be used in companion with this book Perhaps these, and other topics will be covered in a future addition.</p> <p>As networking books go, Java Network Programming 2Ed is close to the top, but has room for improvement. Currently, however, you won't find a book that can beat it, but for advanced topics you'll probably need a second title for topics like servlets or distributed computing.</p>Was this review helpful? Yes NoThank you for your feedback. Report this reviewThank you, this review has been flagged.