May 21, 1999

Using Piped Streams in an Application

Java’s PipedInputStream and PipedOutputStream classes allow you to write data to an OutputStream object and to read this data from an InputStream object (see the tips “Pass Data Between Threads Using Piped Streams” and “Connecting the Piped Stream Classes“). You can use the two stream classes in an application. Typically,

Display Tooltips on Your Hyperlinks

Web authors should be used to using the ALT tag to provide a textual label for an image. However, you can’t apply ALT text to a textual link, and most authors make ALT text extremely concise because browsers often use that text as a placeholder label while the graphic is

Prevent Fields From Being Serialized

Objects are made serializable by implementing the java.io.Serializable interface. In general, when you serialize an object instance, all of the instance’s fields are considered to be part of its state, and will be serialized. For example: public class UserDef extends Object implements Serializable { public String userid; public String password;

Perform Safe Downcasts

A downcast is a cast from a base to a derived object. Before the introduction of RTTI to the language, downcasts were regarded as bad programming practice–they were unsafe and some even considered the reliance on the dynamic type of an object to be a violation of object-oriented principles. You