How to Write Object-Oriented Filters and Encoders
A filter takes a stream of data from its standard input, transforms the data in some way, and sends the results to the standard output. An encoder takes bytes from an input stream, and encodes them as text characters to the output stream. Filters and encoders are powerful programming tools (in fact, well-known utilities on UNIX and MS-DOS shells) that are typically used with I/O redirection and pipes.
This paper revisits the notion of filters and encoders by redesigning them from scratch in an object-oriented way. Detailed examples are given to reuse them in many utility programs useful for embedded development, such as hexDump, wordCounter, space2tab, intelHexFormat, and more. Several small frameworks are presented and their implementation in combination with the flexible and powerful Java I/O package. You will learn how to use filters and encoders to write powerful tools that are applicable at the shell level as well as graphical user interfaces.
Please disable any pop-up blockers for proper viewing of this Whitepaper.