Current area: HOME -> Java -> Disc & File Articles
Disc & File
Create objects from jar files!
Here's your chance to put the expertise you gleaned from two
previous Java Tips to use, as John D. Mitchell takes you
through the intricacies of loading class files and
instantiating the objects of those classes.
Modifying archives
It turns out to be very difficult to modify a jar or zip file using Java's out-of-the-box archive support. This article is the first of a two-part series that will describe a class that permits the painless modification of existing archives. This month, we'll look at the necessary support classes. In Part 2, we'll look at the Archive class itself.
Modifying archives, Part 2: The Archive class
It turns out to be very difficult to modify a .jar or .zip file using Java's out-of-the-box archive support. This article is the second of two, which when taken together describe a class that permits painless modification of existing archives. Last time, we looked at the necessary support classes. This month we turn our attention to the Archive class itself.
Speed up file searching in JFileChooser
Traditionally, users choose files by scrolling the file chooser's list with their mice. You can speed that process by enhancing JFileChooser with a type-ahead method: the user just types the first few characters of a filename to select the desired file. This article shows you how to do just that. Plus, you'll learn how to register listeners on a compound component's descendants to extend JFileChooser's functionality.
Use a RandomAccessFile to build a low-level database
This month, Step by Step's newest contributor, Derek Hamner,
shows you how to use Java's low-level file access to build a
simple database. He uses a RandomAccessFile to store and
retrieve arbitrary record data, allowing serializable objects
to be persisted to a file and then later retrieved via their
key. He wraps up with a demonstration of how his example can be
used in real-world applications.
Working with Binary Files in Java
This article presents a reusable class that deals with binary files. Methods are provided which allow the programmer to read a variety of standard numeric and string formats. Additional methods are provided which take into account signed/unsigned, little/big-endian storage as well as file alignment. Using this class the programmer can read nearly any sort of binary file. An example program is provided that will read the header from a GIF file.