private void writeCurrentByte(){
  if (currentBitIndex < Byte.SIZE - 1) {
    byteStream.write(currentByte);
    currentByte=0;
    currentBitIndex=Byte.SIZE - 1;
  }
}

private void writeCurrentByte ( ) { if ( currentBitIndex < Byte . SIZE - 1 ) { byteStream . write ( currentByte ) ; currentByte = 0 ; currentBitIndex = Byte . SIZE - 1 ; } }
writes pending bits to the stream .
