InputOut

  • Follow


I want to read de characters in an array : ok but I want them todisplay on the screen with OutputStreamWriter, butnothing happens, what's wrong. I know there's a better way, but I wantto do it this way.public class IO{	public static void main (String[]args)	{	   System.out.println("Geef een zin in");           Writer uitvoer = new  OutputStreamWriter(System.out); //streaming to screen      char[]buf = new char[250];      Reader invoer = new InputStreamReader(System.in);	   try{             invoer.read(buf); //ok             uitvoer.write(buf); //nothing appear	   }	   catch(IOException ioe)	   {	     System.out.println("fout bij inlezen");	   }
0
Reply alain.dhaene (1) 3/7/2007 7:49:09 PM

an OutputStreamWriter may be buffered, so flush() it ...Leonard wrote:> I want to read de characters in an array : ok but I want them to> display on the screen with OutputStreamWriter, but> nothing happens, what's wrong. I know there's a better way, but I want> to do it this way.> > public class IO> {> > 	public static void main (String[]args)> 	{> 	   System.out.println("Geef een zin in");>            Writer uitvoer = new  OutputStreamWriter(System.out); //> streaming to screen> > >       char[]buf = new char[250];>       Reader invoer = new InputStreamReader(System.in);> > > 	   try{>              invoer.read(buf); //ok>              uitvoer.write(buf); //nothing appear                uitvoer.flush(); // write immediately and don't buffer> 	   }> 	   catch(IOException ioe)> 	   {> 	     System.out.println("fout bij inlezen");> > 	   }> 
0
Reply Phi 3/7/2007 8:28:37 PM


Please do not top post.Phi wrote:> an OutputStreamWriter may be buffered, so flush() it ...Which is the answer given to your question when you multiposted it to comp.lang.java.help as "IO problem". That was rather unfair to those trying to help you. You should cross post instead, when you feel the need to approach multiple newsgroups at once.-- Lew
0
Reply Lew 3/7/2007 9:48:48 PM

On 7 mrt, 22:48, Lew <l...@nospam.lewscanon.com> wrote:
> Please do not top post.
>
> Phi wrote:
> > an OutputStreamWriter may be buffered, so flush() it ...
>
> Which is the answer given to your question when you multiposted it to
> comp.lang.java.help as "IO problem". That was rather unfair to those trying to
> help you. You should cross post instead, when you feel the need to approach
> multiple newsgroups at once.
>
> -- Lew

Ok, sorry, it won't happen again

0
Reply Leonard 3/8/2007 8:05:19 AM

Lew wrote:> Please do not top post.> > Phi wrote:>> an OutputStreamWriter may be buffered, so flush() it ...> > Which is the answer given to your question when you multiposted it to> comp.lang.java.help as "IO problem". That was rather unfair to those> trying to help you. You should cross post instead, when you feel the> need to approach multiple newsgroups at once.> > -- LewSorry, does "top post" mean, I should not add my Answer to the top ofthe question?Anyway, it was not my intention to add anything to"comp.lang.java.help", because I only subscribed to"comp.lang.java.programmer".Can anybody help me with this "cross post" thing? How does "cross post"work. How do I enable (or disable) it?What acutally is a "Followup-To:" (I can choose it in my ThunderbirdMail Client, but I have no Idea what it means).Thanksphi
0
Reply phi 3/8/2007 12:59:11 PM

phi@gressly.ch wrote:> Lew wrote:>> Please do not top post.>>>> Phi wrote:>>> an OutputStreamWriter may be buffered, so flush() it ...>> Which is the answer given to your question when you multiposted it to>> comp.lang.java.help as "IO problem". That was rather unfair to those>> trying to help you. You should cross post instead, when you feel the>> need to approach multiple newsgroups at once.>>>> -- Lew> > > Sorry, does "top post" mean, I should not add my Answer to the top of> the question?> Anyway, it was not my intention to add anything to> "comp.lang.java.help", because I only subscribed to> "comp.lang.java.programmer".> Can anybody help me with this "cross post" thing? How does "cross post"> work. How do I enable (or disable) it?> What acutally is a "Followup-To:" (I can choose it in my Thunderbird> Mail Client, but I have no Idea what it means).> > Thanks> > phiIn Thunderbird, to cross-post you would type something like:Newsgroup: | *** comp.lang.java.programmer, comp.lang.java.helpor:Newsgroup: | *** comp.lang.java.programmerNewsgroup: | *** comp.lang.java.help(The ***'s are my attempt to denote the little rolodex-card-thingy)Followup-To is basically the newsgroup version of Reply-To: it just tells the client to default to following up to the selected newsgroup(s).
0
Reply Joshua 3/8/2007 10:58:27 PM

5 Replies
80 Views

(page loaded in 0.09 seconds)


Reply: