-2

i got that when executing the code below: (the problem seems to be with the insert method but can't really figure it out) (i would appreciate if you point out the solution)**

        public void writeBit(char bit) throws IOException{
            b.insert(0, bit);
            if(b.length()==8){
                a.write(Integer.parseInt(b.toString()));
                b.setLength(0);
            }
        }
 

The whole code

1 Answers1

-1

Private StringBuilder b is never instantiated.

alexdess
  • 115
  • 1
  • 11