Alternate way to print to Standard Out

Hi,
I have been trying an alternate way to print on the standard out but i dont know where i am going wrong.
this is how I am doing it:
BufferedWriter writer = new BufferedWriter(new
OutputStreamWriter(System.out));
writer.write("hello");
the code compiles well but there is no output. As far as I know, OutputStreamWriter converts char to bytes for the underlying byte stream(System.out) and BufferedWriter converts text into char. So everything should work. But it doesnt.
can someone help me? please also try to explain the process.
Parvez.

can someone help me? please also try to explain the
process.I guess I forgot this part. The reason that you use a buffer is so you don't have to send every single byte out to the stream one by one. If you have a buffer you can delay the send until the buffer is full. So when the buffer gets full, its will automatcially flush those bytes out to the stream. However, if the buffer doesn't reach capacity you will have to forecably flush it yourself in order for those bytes to get on their merry way.

Similar Messages

  • SEVERE: SAAJ0009:  How do I stop stack trace being printed to standard out

    Anyone know why the following stack trace is printed when connection.call(message, endpoint); throws an exception? It happens when the server or web service is offline
    using jdb I can see that the next statement to execute is the return("FAIL .... but the stack trace is already printed by then. How do I tell it not to print the stack trace. I've tried adding a catch for java.io.IOException but the compiler says it's not thrown. Any ideas
    SOAPMessage response = null;
    try{
    response = connection.call(message, endpoint); <= blows up here "myClient.auth myClient.java:333)
    connection.close();
    catch (SOAPException ex){
    return("FAIL Error sending authentication soap message " + ex.getMessage());
    java.io.IOException
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:593)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:272)
    at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:29)
    at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPCon
    ection.java:151)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:12)
    at myClient.auth(myClient.java:333)
    at myClient.send(myClient.java:93)
    at myClient.main(myClient.java:550)
    Caused by: java.net.ProtocolException: Server redirected too many times (20)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:800)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:272)
    at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:27)
    ... 6 more
    May 18, 2004 12:23:05 PM com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection post
    SEVERE: SAAJ0009: Message send failed
    java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send
    failed
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:12)
    at myClient.authenticate(myClient.java:333)
    at myClient.send(myClient.java:93)
    at myClient.main(myClient.java:550)
    Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
    at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:30)
    at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConection.java:151)
    ... 5 more
    Caused by: java.io.IOException
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:593)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:272)
    at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:29)
    ... 6 more
    Caused by: java.net.ProtocolException: Server redirected too many times (20)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:800)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:272)
    at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:27)
    ... 6 more

    For anyone who's interested, apparently I'm not the only one with this problem, others have asked the developrs to remove printStackTrace() from the SAAJ code. For now we have to redirect standard error or ignore

  • I use the "notes" feature on my iphone4 for various lectures and classes. Is there any way to print these notes out?

    I use my "notes" apps for lectures and seminars. Is there any way I can print these notes?

    Synching them to your computer and print it from there.

  • How to print specific pages out of a book file

    I've searched around but I cannot find any way of printing specific pages out of a book file. Has anyone got any ideas? I have a 100 page book file with 20 files, and doing print outs of sections is a nightmare. I want to be able to print page 5 out of file A and page 6 out of file B together so I can duplex them. I've tried scripting this but I can't seem to set the page range of the print preferences of the book file.

    [Jongware] wrote:
    I don't think it's possible to set the page range of a Book.printPreferences
    Theoretically it ought to be possible. Can't test for myself now; what does happen when you set the pageRange to overlapping sub-files?
    I've just tried it with CS3. It might have been implemented in later versions.
    In the print Book dialogue the page range field is disabled. You cannot enter anything there.
    If you try to do it with a script it says that printPreferences is read only.

  • Any way to print-out music catelog on Zen Tou

    I have loaded much - but not all - of my music colllection onto my Zen Touch and it would be convenient to print out exactly what I have loaded. Is there any way to print out the contents?
    Thanks, Robin

    With the predecessor to MediaSource, PlayCentre, you could. The other alternati've is the shareware Notmad Explorer.

  • Is there any way to print out my text messages?

    IM trying to figure out if there is any way to print out my text messages?  thankyou

    You can print off your text message number sent and received by accessing www.verizonwireles.com login with your user id and password. Once logged in select my bill click on usage details then click on messages it will pull up the numbers you can print them from there. If you are looking for the actual messages you will not be to view that information online you can only get that information court ordered subpoena. 

  • HT3529 easiest way to print out my text messages from one person

    I would love to know the easiest way to print out my text messages from one person, how can I do that?
    I just did the last IOS updated, I'm not sure the number after it

    Printing from the iPhone either requires an AirPrint compatible printer, or an app from the App Store. You would have to search to see if they are free or cost. Also, the printing of text messages would either require you to make a screen shot of the message and to print that as a photo, or you would need a 3rd party software on the computer to copy the entire message to the computer and print from there. There is no native print capability for entire message threads.

  • Is there any way to print out information from the Health Dashboard such as Blood Pressure readings to take to doctor?

    I am having to keep track of my blood pressure for several weeks and then take them to the doctor just to make sure I'm doing okay.  Is there a way to print out the readings that I have entered into the dashboard on the Health App?  Or am I going to have to copy down all those weeks worth of readings by hand?

    Thanks for the reply. I hope in the near future they make it an option. Maybe that you can email it like you can with notes.
    I will have my phone with me but they will need a hard copy to scan in to my records or at least to enter manually in to their system. Maybe I will just start keeping track of my health info in the notes app again so I can email myself a copy to print.

  • When u face time a friend is there a way to print out the verbal conversation you have with them.

    When you have a verbal conversation on facetime is there a way to print out that converstaion.

    No.

  • Is there a way to print out my itunes purchases, credits (from giftcards) and what is being charged to my credit ca

    Is there a way to print out my itunes purchases, credit (from gift cards) and what amounts are being charged to my actual credit card?  I have two children sharing this account (each with their own gift cards) and I'm trying to keep it fair on who spends what....etc.  PLEASE help.  I'm losing my mind! 

    The ability to connect to the printer or the G5 over the Internet will depend on your company's network. In the good ol' days of modems, you could use a dial-up connection to access your network remotely. Now with cable connections the same can be done, but there are a number of openings that need to be made by your IT dept to allow you access and to restrict others. So you should discuss your desire to remotely connect with them. They could share the printer so that once you are connected to your network, you could use IPP (Internet Printing Protocol) to connect to the printer share and still use the HP driver.
    PaHu

  • No way to print report instance

    When users view a report instance that was saved as an MS Excel spreadsheet the print option does not automatically appear in the toolbar.  Is there a way to make the Standard options appear in the toolbar?

    Hi Ray
    Which product are you using?Also mention it's version.
    Can you please explain in brief what have you done and what you are looking out for.
    Thanks
    Soni

  • A better way to print text from within java ?

    Hi, I want to make an app that brints out a bill (part of a bigger project for school) and I already know how to make my object printable and print it, but the "problem" lies in the graphics (or graphics2D) object that the print function uses to draw on the printable.
    The bill contains large amounts of text and as far as I know graphics and graphics2D only have drawString() as method to draw a string, and on top of that it does not support the newline char, so is there a way to print large amounts of text in another way ?
    also, since I'm using numbers and currency, would it be possible to alight text, so that it ends up like this:
    name of item          100.00 Euros
    name of other item       1.00 Euronicely aligned to the left for the names, and to the right for the numbers, the problem is that i'd like to keep that in a nonfixed width font, so calculating the needed position will be hard.
    thanks in advance,
    Boran.

    Within the 2D Graphics system there are methods for dealing with this. Check out the AttrributedCharacterIterator class and the TextLayout class. A good read is
    'Java 2D Graphics' by Jonathan Knudsen published by O'Reilly ISBN 1-56592-484-3 .

  • Any way to Print report generated as HTML

    Hi All.
    We are using FM WWW_HTML_FROM_LISTOBJECT to convert a list to HTML and show it in HTML container.
    Now, is there a way to Print this document?
    If I right-click and print, it uses the IE settings - i.e. if in the IE page setup, header and footer are there, the same will come up in printing. We don't want them to come. We want only SAP header/footer to come.
    Any clues anyone?
    Thanks in adv.

    We now support saving a response from the View Responses tab to PDF (that retains the form design shown on the Design tab). The PDF can be shared, archived or printed using Adobe Reader.
    You can read more about it here: http://forums.adobe.com/thread/1085672
    Please try it out and give us your feedback.
    Randy

  • Is there a way to print from ipad 4 to a non AirPrint printer? I have a Canon Pixma MP 620 wifi which works fine with my PC but I don't want to buy a new printer. Is there an app for this or adaptors which could work?   thank, Ric

    Is there a way to print from ipad 4 to a non AirPrint printer?
    I have a Canon Pixma MP 620 wifi which works fine with my PC but I don't want to buy a new printer.
    Is there an app for this or adaptors which could work? 
    Thank, Ric

    Printopia is another option but be aware that since these solutions effectively act as a print server and AirPrint receiver, they require a computer to be running on the same WiFi network.
    Canon also has a couple of apps in the App Store that might facilitate this on non-AirPrint printers. Check out...
    Canon Easy-PhotoPrint
    Canon Mobile Printing
    PIXMA Printing Solutions

  • Any way to print from Finder?

    Sorry about my last post...I really messed up!
    Here I go again. Is there any way to print from the finder? I have a DVD inserted into my drive, and I want to print the contents to have as a reference. I tried to print the contents of the disk from Toast, but couldn't find out how there, either. Thanks for any help! Regina

    Open the Script Editor in the /Applications/Utilities/ folder and paste in the following:
    tell application "Finder"
    quoted form of POSIX path of (selection as alias)
    end tell
    do shell script "ls -R " & the result
    Select the DVD in the Finder, press the Run button from the Script Editor, and copy the text from the result pane into a place it can be printed.
    (29327)

Maybe you are looking for

  • Accessing Home Hub 4 with windows 8.1 and Internet...

    Hello I can no longer access my home hub manager wirelessly running windows 8.1 and Internet Explorer 11 from my toshiba laptop by either typing in the IP address or by http://bthomehub.home/. I can still access it by either method from a laptop runn

  • QoS: Multiple acl entries cannot be used in match-any in class Match_XY

    Hello All, I'm getting below error while trying to add the two extended ACL in the class-map for classifying the traffic. Is there any way I can add two extenteded ACL in the same class-map for classifying the traffic. Error log: "QoS: Multiple acl e

  • Sqlagent90.exe keeps running in a command window

    HELP!, This is annoying and beyond belief.  I installed SqlServer Developer edition without any problem than I installed SqlServer Express and now whenever I boot my PC, I have a command window that appear with nothing in it and the following title:

  • XMLForm problem with XSL Stylesheet

    Hello all, I've been asked to have a look at a problem that a friend is having with XMLForms. They have recently upgraded to NW04 SP11 (from NW04 SP9) and now they cannot 'Create New' for each of the XML forms that they based on 'SAP Demo News'. They

  • Play it again, Sam (ie. retry the statement)

    there is a merge statement that causes ORA-08006 error from time to time: specified row no longer exists. I found out that the main solution cited on the internet is to retry the operation: ORA-08006: specified row no longer exists Cause: the row has