public void writeString(byte[] string) throws IOException {
  flushBits();
  if (string != null) {
    out.write(string);
  }
  out.write(0);
  bytesWritten+=string.length + 1;
}

public void writeString ( byte [ ] string ) throws IOException { flushBits ( ) ; if ( string != null ) { out . write ( string ) ; } out . write ( 0 ) ; bytesWritten += string . length + 1 ; }
write a string to the output stream and add terminating null
