Total members 11889 |It is currently Fri Mar 29, 2024 3:28 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Read file content to StringBuffer String object

java code
import java.io.*;

public class FileSpace {

private FileInputStream in;

public FileSpace(String filename) {
in = new FileInputStream(filename);
}

public String readWord() {
int c;
StringBuffer buf = new StringBuffer();

do {
c = in.read();
if (Character.isSpace((char)c))
return buf.toString();
else
buf.append((char)c);
} while (c != -1);

return buf.toString();
}
}




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Read file content to StringBuffer String object
 Read XML file content using SAX and writing its as SQL     -  
 difference between the String and StringBuffer     -  
 help me regarding StringBuffer.indexOf(String)     -  
 Read the content from directory     -  
 Print the content of hashMap object     -  
 How to read string text in files     -  
 Converting Session object into string     -  
 display the content of text file     -  
 Load file and update content using AJAX and JQuery     -  
 read from file in C++     -  



Topic Tags

Java Strings
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com