Revision 2172
tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java (revision 2172) | ||
---|---|---|
115 | 115 |
return getReader(file, UTF8); |
116 | 116 |
} |
117 | 117 |
|
118 |
/** |
|
119 |
* |
|
120 |
* @param file |
|
121 |
* @param encoding if null the "UTF-8" encoding is used |
|
122 |
* @return |
|
123 |
* @throws UnsupportedEncodingException |
|
124 |
* @throws FileNotFoundException |
|
125 |
*/ |
|
118 | 126 |
public static BufferedReader getReader(File file, String encoding) throws UnsupportedEncodingException, FileNotFoundException { |
127 |
if (encoding == null) encoding = "UTF-8"; // prevent null exception |
|
128 |
|
|
119 | 129 |
FileInputStream input = new FileInputStream(file); |
120 | 130 |
DetectBOM db = new DetectBOM(file); |
121 | 131 |
for (int ibom = 0 ; ibom < db.getBOMSize() ; ibom++) |
Also available in: Unified diff