File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Performance and the fly likes File Vs ByteArrayInputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Performance
Reply Bookmark "File Vs ByteArrayInputStream" Watch "File Vs ByteArrayInputStream" New topic
Author

File Vs ByteArrayInputStream

Meghana Reddy
Ranch Hand

Joined: Jan 29, 2002
Posts: 48
Hi all,
1) I am using a ByteArrayInputStream as InputSource for the SAXParser.parse method for XML Parsing.
2) The other way I can do this is to create a file and write the XML string into the file and pass the file object as InputSource to the SAXParser.
The SAXParser i am using is xerces.jar
Any idea on wht r the pros and cons of performance in both the scenarios 1 & 2.
Thnks in adv


Meghana Reddy
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Writing the content to a file on disk certainly will be slower than the pure in-memory solution.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
 
subject: File Vs ByteArrayInputStream
 
Threads others viewed
XML Parsing with international characters
xml as byte array
Problems parsing a string with SAX
xpath evaluate exception
XPath evaluate exception
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture