Answer by jforberg for Problems reading text from file
Is the file in utf-8 (unicode) format? For some reason, Notepad always adds a byte-order mark to unicode files, even when the byte-order is irrelevant. When interpreted as ASCII or ANSI, the BOM will...
View ArticleAnswer by Sunil Kumar Sahoo for Problems reading text from file
Try with the folowing codeFile f = new File(str);FileInputStream fis = new FileInputStream(f); byte[] mydata1 = new byte[(int) f.length()]; fis.read(mydata1);System.out.println("...data present in...
View ArticleAnswer by LuckyLuke for Problems reading text from file
Wrap a FileReader object in the BufferedReader object instead. http://download.oracle.com/javase/1.4.2/docs/api/java/io/FileReader.htmlFile sd = Environment.getExternalStorageDirectory();File file =...
View ArticleProblems reading text from file
I'm trying to read some text from a .txt file, here's my code:String filePath = bundle.getString("filepath"); StringBuilder st = new StringBuilder(); try { File sd =...
View Article