@Override
    public synchronized void writeBit(int bit) throws BitStreamException
    {
         bit &= 1;
         this.out.print((bit == 1) ? "1" : "0");
         this.current <<= 1;
         this.current |= bit;
         this.lineIndex++;

         if (this.mark == true)
             this.out.print("w");

         if (this.width != -1)
         {
             if ((this.lineIndex-1) % this.width == this.width-1)
             {
                 if (this.showByte())
                     this.printByte(this.current);

                 this.out.println();
                 this.lineIndex = 0;
             }
             else if ((this.lineIndex & 7) == 0)
             {
                 this.out.print(" ");

                 if (this.showByte())
                     this.printByte(this.current);
             }
         }
         else if ((this.lineIndex & 7) == 0)
         {
             this.out.print(" ");

             if (this.showByte())
                 this.printByte(this.current);
         }

        this.delegate.writeBit(bit);
    }