Some reader favorites:
EJB fundamentals and session beans
Create a scrollable virtual desktop in Swing
OSGi without the Eclipse
It's become common to equate OSGi with Eclipse or Equinox, but in fact other OSGi implementations exist. This post from JW
blogger Oleg Mikheev fills a much needed gap - walking through the process of developing a Hello World bundle with Apache Felix and the IDE of your choice.
| Memory Analysis in Eclipse |
| Enterprise AJAX - Transcend the Hype |
I initially set out to design a data-reading character-stream filter class. Analogous to the byte-stream filter DataInputStream, this character-stream filter was intended to provide the capability to read textual data from a character stream (namely
the output of a human or the PrintWriter println() method).
Let me now, in retrospect, describe what I actually implemented.
First, I created an UndoReader class. This character-stream filter supports three special methods:
checkpoint()commit()rollback()As you read characters through the stream, you have the option to checkpoint the stream -- that is, save the stream's current state and put it into a mode such that it stores all data subsequently read
through it. From that point on, the UndoReader stores all the data you read. After any amount of reading, choosing to commit the stream will cause the stored data to be discarded, after which reading proceeds undisturbed. Alternatively, choosing
to rollback the stream will cause it to rewind and revert to reading from the position at which you asserted the checkpoint -- just as
if you hadn't yet read anything. This stream also supports a couple of related methods.
Next, I implemented the DataReader class, the character-stream filter. This class makes use of the UndoReader class and provides methods to read all the primitive Java types (readInt(), readFloat(), readBoolean(), and so on). What is special about this class is that if you attempt to read a primitive from the stream and it turns out
the stream data is incorrect -- if, for example, you attempt to read a Boolean and the next token in the stream is truthfulness -- it rolls back, un-reading any characters read during the erroneous operation, and throws an exception. The stream also supports a feature whereby it
can read data one line at a time, signaling each time the end of a line is reached (among other wonders).
The classes I developed will only work in JDK 1.1-plus. Adapting them to work as InputStreams, usable under JDK 1.0.2, should be quite easy, however.
In the interest of brevity, I'll spare you an introduction to character streams. Todd Sundsted's November 1997 How-To Java column should serve that purpose quite adequately; if you want an introduction to byte streams, check out Todd's October 1997 column. For further details of the Java stream classes, I refer you to Java Network Programming, Second Edition, which I coauthored with Michael Shoffner and Derek Hamner, and which is due out any day now. (See Resources.)