Class Dictionnaire

java.lang.Object
  extended by Dictionnaire

public class Dictionnaire
extends java.lang.Object

Class used for the decoding process.


Constructor Summary
Dictionnaire()
          The constructor used for creating the dictionary initially.
 
Method Summary
static void ajouteMot(java.lang.String m)
          adds a word to the dictionary.
static int lireEntier(java.io.FileInputStream fichier, int n)
          This method is used during decoding for reading a sequence of 0 and 1's in a FileInputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dictionnaire

public Dictionnaire()
The constructor used for creating the dictionary initially.

Method Detail

ajouteMot

public static void ajouteMot(java.lang.String m)
adds a word to the dictionary.

Parameters:
m - the word which is added to the dictionary

lireEntier

public static int lireEntier(java.io.FileInputStream fichier,
                             int n)
                      throws java.io.IOException
This method is used during decoding for reading a sequence of 0 and 1's in a FileInputStream. It returns the integer whose binary representation corresponds to the sequence of bits which is read. The least significant bit is read first. For instance when the sequence 1,1,0,1 is read the number 11 is returned.

Parameters:
fichier - the FileInputStream which is read by the decoding process.
n - the number of bits which is read in the FileInputStream.
Returns:
the integer whose binary representation corresponds to the sequence of bits which is read.
Throws:
java.io.IOException