Skip to Content
Java I/O
book

Java I/O

by Elliotte Rusty Harold
March 1999
Intermediate to advanced
600 pages
16h 25m
English
O'Reilly Media, Inc.
Content preview from Java I/O

JAR Files

Java 1.1 added support for Java ARchive files, JAR files for short. JAR files bundle the many different classes, images, and sound files an applet requires into a single file. It is generally faster for a web browser to download one JAR file than to download the individual files the archive contains, since only one HTTP connection is required. An applet stored in a JAR file, instead of as merely loose .class files, is embedded in a web page with an <applet> tag with an archive attribute pointing to the JAR file. For example:

<applet code=NavigationMenu archive="NavigationMenu.jar" width=400 height=80>
</applet>

The code attribute still says that the main class of this applet is called NavigationMenu. However, a Java 1.1 web browser, rather than asking the web server for the file NavigationMenu.class as a Java 1.0 web browser would, asks the web server for the file NavigationMenu.jar. Then the browser looks inside NavigationMenu.jar to find the file NavigationMenu.class. Only if it doesn’t find NavigationMenu.class inside NavigationMenu.jar does it then go back to the web server and ask for NavigationMenu.class. Now suppose the NavigationMenu applet tries to load an image called menu.gif. The applet will look for this file inside the JAR archive too. It only has to make a new connection to the web server if it can’t find menu.gif in the archive.

Sun wisely decided not to attempt to define a new file format for JAR files. Instead, they stuck with the tried-and-true zip format. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java I/O, 2nd Edition

Java I/O, 2nd Edition

Elliotte Rusty Harold

Publisher Resources

ISBN: 1565924851Catalog PageErrata