public void write(String chaine) throws IOException
    {   
        for (int i = 0; i<chaine.length(); i++)
        {
            this.writeBit(Character.getNumericValue(chaine.charAt(i)));
        }
        
        if (this.bits != 0) {
            this.ecrire.write(this.bits);
        }
        
        this.ecrire.close();
    }