Index: lutinutil/src/java/org/codelutin/util/FileUtil.java diff -u lutinutil/src/java/org/codelutin/util/FileUtil.java:1.7 lutinutil/src/java/org/codelutin/util/FileUtil.java:1.8 --- lutinutil/src/java/org/codelutin/util/FileUtil.java:1.7 Fri Apr 7 16:08:47 2006 +++ lutinutil/src/java/org/codelutin/util/FileUtil.java Mon Aug 7 19:30:24 2006 @@ -23,10 +23,10 @@ * Created: 22 nov. 2004 * * @author Benjamin Poussin - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ * - * Mise a jour: $Date: 2006/04/07 16:08:47 $ - * par : $Author: ruchaud $ + * Mise a jour: $Date: 2006/08/07 19:30:24 $ + * par : $Author: bpoussin $ */ package org.codelutin.util; @@ -38,14 +38,9 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; -import java.io.Reader; -import java.io.UnsupportedEncodingException; -import java.io.Writer; import java.nio.channels.FileChannel; import java.util.ArrayList; import java.util.Arrays; @@ -155,18 +150,18 @@ * Permet de lire un fichier et de retourner sont contenu sous forme d'une * chaine de carateres * @param file le fichier a lire - * @throws FileNotFoundException + * @throws IOException */ static public String readAsString(File file) throws IOException { - String result = ""; + StringBuffer result = new StringBuffer(); + char [] cbuf = new char[2000]; BufferedReader in = getReader(file); - String tmp = in.readLine(); - while (tmp != null) { - result += tmp + "\n"; - tmp = in.readLine(); + int nb = in.read(cbuf); + while (nb != -1) { + result.append(cbuf, 0, nb); + nb = in.read(cbuf); } - in.close(); - return result; + return result.toString(); } /** Index: lutinutil/src/java/org/codelutin/util/LRUMapMultiKey.java diff -u lutinutil/src/java/org/codelutin/util/LRUMapMultiKey.java:1.1 lutinutil/src/java/org/codelutin/util/LRUMapMultiKey.java:1.2 --- lutinutil/src/java/org/codelutin/util/LRUMapMultiKey.java:1.1 Tue May 23 13:55:52 2006 +++ lutinutil/src/java/org/codelutin/util/LRUMapMultiKey.java Mon Aug 7 19:30:24 2006 @@ -23,9 +23,9 @@ * Created: 23 mai 2006 04:08:03 * * @author poussin - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * - * Last update: $Date: 2006/05/23 13:55:52 $ + * Last update: $Date: 2006/08/07 19:30:24 $ * by : $Author: bpoussin $ */ @@ -51,6 +51,8 @@ public class LRUMapMultiKey extends LinkedHashMap { + private static final long serialVersionUID = 1L; + private static final Log log = LogFactory.getLog(LRUMapMultiKey.class); /** @@ -59,7 +61,9 @@ */ static public class Key extends ArrayList { -// protected LRUMapMultiKey map = null; + private static final long serialVersionUID = 1L; + + // protected LRUMapMultiKey map = null; // protected Reference ref = null; protected int hash = 0; @@ -195,7 +199,7 @@ Object k = i.next(); Set list = keys.get(k); if (list != null) { - boolean ok = list.remove(key); + list.remove(key); if (list.size() == 0) { keys.remove(k); }