Created
May 7, 2012 10:33
-
-
Save wfwei/2627138 to your computer and use it in GitHub Desktop.
java io
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StringBuffer sb = new StringBuffer(); | |
File f = new File(file); | |
if (f.exists()) { | |
System.out.println("file not exist"); | |
try { | |
BufferedReader br = new BufferedReader(new InputStreamReader( | |
new FileInputStream(f))); | |
while ((s = br.readLine()) != null) { | |
sb.append(s); | |
} | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment