Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I convert a String object to a character Stream

Status
Not open for further replies.

DCCoolBreeze

Programmer
Jul 25, 2001
208
US
I have a string object that is holding the contents of an XML file. I need to parse the XML (SAX). The parser expects an InputSource object. This object will allow a character stream or a byte stream.

How is this done in Java. In fact, what is the difference between a String object and a character Stream object besides the fact that the Stream object is not bounded by length????
 
new InputStream( new StringReader( yourString));

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top