Click here to Skip to main content
   

Java

 
AnswerRe: am a beginner PinmvpRichard MacCutchan15-Jan-13 23:54 
GeneralRe: am a beginner Pinmembercubocik16-Jan-13 1:38 
GeneralRe: am a beginner PinmvpRichard MacCutchan16-Jan-13 1:52 
GeneralRe: am a beginner Pinmembercubocik16-Jan-13 1:55 
GeneralRe: am a beginner Pingrouponyebumichael16-Jan-13 12:03 
AnswerRe: am a beginner [modified] PinmemberApril Fans16-Jan-13 20:46 
GeneralRe: am a beginner PinmvpRichard MacCutchan17-Jan-13 0:40 
Questionhelp me please Pinmemberterzasek13-Jan-13 18:10 
how to write main class for run this class.
1. edit this class.
2. create main class for run
I need to write , read text file path C:\\file.txt
anyone help me please.
 
package
import java.io.*;

public class TextFileOperator {
public TextFileOperator(String path){
f = new File(path);
}
File f;
public void write(String text, boolean isAppend){
FileOutputStream out = new FileOutputStream(f,isAppend);
OutputStreamWriter wr = new OutputStreamWriter(out);
wr.write(text);
wr.close();
out.close();
}
public String read()
{
FileReader reader = new FileReader(f);
BufferedReader bf = new BufferedReader(reader);
StringBuilder bd = new StringBuilder();
String s;
while((s = bf.readLine()) != null){
bd.append(s);
bd.append("\n");
}
return bd.toString();
}
}
AnswerRe: help me please PinmvpRichard MacCutchan13-Jan-13 23:23 
AnswerRe: help me please PinmemberAvidwan14-Jan-13 5:41 
GeneralRe: help me please PinmvpRichard MacCutchan14-Jan-13 7:22 
GeneralRe: help me please Pinmembercubocik16-Jan-13 1:40 
QuestionWebpage saver -- help Pinmembercubocik13-Jan-13 8:38 
SuggestionRe: Webpage saver -- help PinmvpRichard MacCutchan13-Jan-13 23:18 
GeneralRe: Webpage saver -- help Pinmembercubocik14-Jan-13 6:51 
GeneralRe: Webpage saver -- help PinmvpRichard MacCutchan14-Jan-13 7:12 
GeneralRe: Webpage saver -- help Pinmembercubocik14-Jan-13 7:34 
GeneralRe: Webpage saver -- help Pinmembercubocik14-Jan-13 7:39 
GeneralRe: Webpage saver -- help PinmvpRichard MacCutchan14-Jan-13 7:55 
GeneralRe: Webpage saver -- help Pinmembercubocik14-Jan-13 8:55 
GeneralRe: Webpage saver -- help PinmvpRichard MacCutchan14-Jan-13 23:02 
GeneralRe: Webpage saver -- help Pinmembercubocik16-Jan-13 1:38 
GeneralRe: Webpage saver -- help PinmvpRichard MacCutchan16-Jan-13 1:51 
QuestionHow to Record Audio at client Side? PinmemberMrugrajsinh13-Jan-13 8:19 
Questioncode error PinmemberMember 975139812-Jan-13 13:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150327.1 | Last Updated 30 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid