SHARE
TWEET

Bug?

a guest Sep 9th, 2014 157 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public TreeSet<String> readFile(String fileRead){
  2.         FileHandle file;
  3.         TreeSet<String> dict = new TreeSet<String>();
  4.         if(Gdx.files.internal(fileRead).exists()) {
  5.  
  6.             file=Gdx.files.internal(fileRead);
  7.  
  8.             BufferedReader in = null;
  9.             String line;
  10.             try {
  11.                 in = file.reader(1024);
  12.                 while ((line = in.readLine()) != null) {
  13.                     dict.add(line.split(":")[0]);
  14.                 }
  15.  
  16.             } catch (FileNotFoundException e) {
  17.                 e.printStackTrace();
  18.             } catch (IOException e) {
  19.                 e.printStackTrace();
  20.             } finally {
  21.                 try {
  22.                     if (in != null)
  23.                         in.close();
  24.                 } catch (IOException e) {
  25.                     e.printStackTrace();
  26.                 }
  27.             }
  28.         }
  29.         return dict;
  30.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top