Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

InputOut

Thread view: 
Leonard - 07 Mar 2007 19:49 GMT
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
      }
      catch(IOException ioe)
      {
        System.out.println("fout bij inlezen");

      }
Phi - 07 Mar 2007 20:28 GMT
an OutputStreamWriter may be buffered, so flush() it ...

> I want to read de characters in an array : ok but I want them to
> display on the screen with OutputStreamWriter, but
[quoted text clipped - 16 lines]
>              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");
>
>       }
Lew - 07 Mar 2007 21:48 GMT
Please do not top post.

> 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
phi@gressly.ch - 08 Mar 2007 12:59 GMT
> Please do not top post.
>
[quoted text clipped - 6 lines]
>
> -- 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

phi
Joshua Cranmer - 08 Mar 2007 22:58 GMT
>> Please do not top post.
>>
[quoted text clipped - 19 lines]
>
> phi
In Thunderbird, to cross-post you would type something like:

Newsgroup: | *** comp.lang.java.programmer, comp.lang.java.help

or:

Newsgroup: | *** comp.lang.java.programmer
Newsgroup: | *** 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).


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.