• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
System.out & ByteArrayOutputStream
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

System.out & ByteArrayOutputStream


  • Subject: System.out & ByteArrayOutputStream
  • From: Nathan Dumar <email@hidden>
  • Date: Wed, 10 Nov 2004 13:51:38 -0500

I'm reading the docs but coming up short. I want to send an email when I get a message posted to System.out or System.err. So far, I have ...

	// none of this has been tested yet
	ByteArrayOutputStream baos = new ByteArrayOutputStream();
	PrintStream ps = new PrintStream(baos);
	System.setOut(ps);
	System.setErr(ps);

I can do baos.toString() to get the String I need for the body of the email. The problem is that when my ByteArrayOutputStream baos gets written to, I need to do stuff, then send the email.

I can't figure out a way to set off another method after baos gets data. Any ideas?

Thank you,
Nathan

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: System.out & ByteArrayOutputStream
      • From: Owen Jones <email@hidden>
  • Prev by Date: RE: EOF inserts PK automatically
  • Next by Date: Re: PostgreSQL Adaptor and Plugin
  • Previous by thread: NEVERMIND worked yesterday, fails today.
  • Next by thread: Re: System.out & ByteArrayOutputStream
  • Index(es):
    • Date
    • Thread