Author: nextgens
Date: 2007-04-13 15:11:19 +0000 (Fri, 13 Apr 2007)
New Revision: 12630

Modified:
   trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
Log:
Toad tell to me that FileWriter might have Locale related issues ... let's get 
rid of it then.

Modified: trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java        
2007-04-13 14:59:43 UTC (rev 12629)
+++ trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java        
2007-04-13 15:11:19 UTC (rev 12630)
@@ -1,7 +1,8 @@
 package freenet.node.fcp;

+import java.io.BufferedOutputStream;
 import java.io.File;
-import java.io.FileWriter;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.net.Socket;
 import java.util.HashMap;
@@ -361,9 +362,12 @@
                        // client somehow that the node can't write there... 
And setting readFile to null means we won't inform
                        // it on the status (as if it hasn't requested us to do 
the test).
                        try {
-                               FileWriter fw = new 
FileWriter(result.readFilename);
-                               fw.write(result.readContent);
-                               fw.close();
+                               FileOutputStream fos = new 
FileOutputStream(result.readFilename);
+                               BufferedOutputStream bos = new 
BufferedOutputStream(fos);
+                               bos.write(result.readContent.getBytes());
+                               bos.flush();
+                               bos.close();
+                               fos.close();
                        } catch (IOException e) {
                                Logger.error(this, "Got a IOE while creating 
the file (" + readFile.toString() + " ! " + e.getMessage());
                        }


Reply via email to