/ ** Author: WHXBB * /
public void log (String fileName, String content) throws Exception {String logMsg = new Date () toLocaleString () ":" content "/ r / n"; ByteBuffer bbf = ByteBuffer.wrap (logMsg.getBytes (). ); File file = new file (filename); if (! File.exists ()) file.createNewFile (); boolean append = true; filechannel wchannel = new fileoutputstream (file, append) .getchannel (); wchannel.write BBF); wchannel.close ();