23.07.2013 Views

Java IO.pdf - Nguyen Dang Binh

Java IO.pdf - Nguyen Dang Binh

Java IO.pdf - Nguyen Dang Binh

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

A.5 Data Compression<br />

<strong>Java</strong> I/O<br />

<strong>Java</strong> supports several related compression formats, including zlib, deflate, and gzip. These<br />

formats are documented in RFCs 1950, 1951, and 1952, and are available wherever RFCs are<br />

found, including http://www.faqs.org/rfcs/. The master site for these particular RFCs is<br />

ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html.<br />

<strong>Java</strong>'s compression classes are native wrappers around the ZLIB compression library written<br />

by Jean-Loup Gailly and Mark Adler. You can learn about this library at<br />

http://www.cdrom.com/pub/infozip/zlib/.<br />

For more general information about compression and archiving algorithms and formats, the<br />

comp.compression FAQ is a good place to start. See http://www.faqs.org/faqs/compressionfaq/part1/preamble.html.<br />

More technical details and sample code in C for a variety of<br />

algorithms are available in The Data Compression Book, by Mark Nelson and Jean-Loup<br />

Gailly (M&T Books, 1996, ISBN 1-55851-434-1).<br />

The JAR file format was developed by Sun for <strong>Java</strong>. The full specification can be found at<br />

http://java.sun.com/products/jdk/1.2/docs/guide/jar/jarGuide.html ( <strong>Java</strong> 2) or<br />

http://java.sun.com/products/jdk/1.1/docs/guide/jar/jarGuide.html ( <strong>Java</strong> 1.1). Aside from the<br />

name, the only thing that really distinguishes a JAR file from a zip file is the optional<br />

manifest of the contents. The manifest format specification can be found at<br />

http://java.sun.com/products/jdk/1.2/docs/guide/jar/manifest.html.<br />

A.6 Encryption and Related Technology<br />

Chapter 10 only began to explore the fascinating subject of cryptography. The JCE is<br />

explicated in much more detail by Jonathan Knudsen in <strong>Java</strong> Cryptography (O'Reilly &<br />

Associates, 1998) <strong>Java</strong> Cryptography expands on the coverage of the Cipher and<br />

MessageDigest classes you'll find in this book. It also includes thorough discussions of the<br />

java.security package and the <strong>Java</strong> Cryptography Extension (JCE), showing you how to<br />

use security providers and even implement your own provider. It discusses authentication, key<br />

management, and public and private key encryption and includes a secure talk application that<br />

encrypts all data sent over the network. If you write <strong>Java</strong> programs that communicate<br />

sensitive data, you'll find this book indispensable.<br />

For a more in-depth look at the mathematics and protocols that underlie the JCE, you'll want<br />

to check out Bruce Schneier's Applied Cryptography (John Wiley & Sons, 1995). This is the<br />

standard practical text on cryptographic protocols and algorithms, and the attacks on them.<br />

Schneier discusses a wide range of cryptographic algorithms, key management and exchange<br />

schemes, one-way hash functions, signature algorithms, and many other problems in<br />

sufficient detail to allow a competent programmer to implement them. Although Schneier's<br />

language of choice is C, the techniques discussed are applicable in any language.<br />

The formal specification of the <strong>Java</strong> Cryptography API is available from Sun at<br />

http://java.sun.com/products/jdk/1.2/docs/guide/security/CryptoSpec.html. The actual<br />

implementation is in beta at the time of this writing and can be downloaded from<br />

http://developer.java.sun.com/developer/earlyAccess/jdk12/jce.html.<br />

461

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!