tut08_2009 - EE3206/EE5805 Java Programming Applications...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
EE3206/EE5805 Java Programming & Applications Tutorial 8 – Exception Handling and Binary IO Run-length encoding (RLE) is a very simple form of data compression in which a run of data are stored as a pair of symbol and count , rather than as the original run. This is most useful on data that contains many such runs: for example, relatively simple graphic images such as icons, line drawings, and animations. For example, consider the following scan line where B represents a black pixel and W represents white: WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW When RLE data compression algorithm is applied to the above scan line, it becomes: W12 B1 W12 B3 W24 B1 W14 The new scan line is interpreted as twelve W's, one B, twelve W's, three B's, etc. Obviously, this representation is more compact and efficient. In this exercise, you are required to write a RLE Codec (co der/dec oder). 1. A RLE codeword is composed of a symbol and a count. Given the class Codeword in Code 1, study the code throughout and create this class in your project. 2. The interface CodewordOutput and CodewordInput define methods for writing and reading RLE codewords from a binary stream, as shown in Code 2 and Code
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/20/2010 for the course ELECTRONIC EE3206 taught by Professor Tingchiwang during the Spring '10 term at École Normale Supérieure.

Page1 / 4

tut08_2009 - EE3206/EE5805 Java Programming Applications...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online