public int write(String words) {
    if (mode.isWritable() == false)
      throw new IllegalStateException("IOError: not opened for writing");

    try {
      raFile.write(words.getBytes());
    } catch (IOException e) {
      logger.log(Level.SEVERE, null, e);
      throw new RuntimeException(e);
    }
    return words.getBytes().length;
  }
public int write ( String words ) { if ( mode . isWritable ( ) == false ) throw new IllegalStateException ( "IOError: not opened for writing" ) ; try { raFile . write ( words . getBytes ( ) ) ; } catch ( IOException e ) { logger . log ( Level . SEVERE , null , e ) ; throw new RuntimeException ( e ) ; } return words . getBytes ( ) . length ; }
Writes to the file.

@param words
to write
@return the number of written bytes.
@throws IllegalStateException
if file is not writable