<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SCJP Certification &#187; file</title>
	<atom:link href="http://www.scjp-certification.com/tag/file/feed" rel="self" type="application/rss+xml" />
	<link>http://www.scjp-certification.com</link>
	<description>Sun Certified Java Programmer Certification exam essentials</description>
	<lastBuildDate>Fri, 30 Sep 2011 05:54:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>What is fileInputStream class?</title>
		<link>http://www.scjp-certification.com/what-is-fileinputstream-class.html</link>
		<comments>http://www.scjp-certification.com/what-is-fileinputstream-class.html#comments</comments>
		<pubDate>Sat, 31 Oct 2009 11:39:02 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Facts]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[FileInputStream]]></category>
		<category><![CDATA[input operations]]></category>
		<category><![CDATA[sequential manner]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=340</guid>
		<description><![CDATA[The FileInputStream class is used to is used to read binary data from a file. It is used to perform...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-fileinputstream-class.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-fileinputstream-class.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The FileInputStream class is used to is used to read binary data from a file. It is used to perform simple file input operations. It reads data in a sequential manner, but can skip a region of data as per requirement. It generally reads data in a sequential manner, but can skip a region of data as per requirement. FileInputStream class can be instantiated by using any of the following three constructors:
<li> FileInputStream (String <i> name</i>)</li>
<li> FileInputStream (File <i> file</i>)</li>
<li> FileInputStream (FileDescriptor <i> fdObject</i>)</li>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-fileinputstream-class.html&amp;title=What%20is%20fileInputStream%20class%3F"><img src="http://www.scjp-certification.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.scjp-certification.com/what-is-fileinputstream-class.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is the FileOutputStream class?</title>
		<link>http://www.scjp-certification.com/what-is-the-fileoutputstream-class.html</link>
		<comments>http://www.scjp-certification.com/what-is-the-fileoutputstream-class.html#comments</comments>
		<pubDate>Wed, 23 Sep 2009 12:10:24 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Facts]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[FileNotFoundException]]></category>
		<category><![CDATA[FileOutputStream class]]></category>
		<category><![CDATA[ObjectInputStream]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=250</guid>
		<description><![CDATA[The FileOutputStream class is used to perform simple file output operations. It is used to write binary data to a...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-the-fileoutputstream-class.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-the-fileoutputstream-class.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The FileOutputStream class is used to perform simple file output operations. It is used to write binary data to a file. The FileOutputStream class can be instantiated by using any of the following constructors:
<ol>
<li><strong>FileOutputStream(String  name):</strong> This constructor creates a connection to write to the file with the name specified in the argument. It throws a FileNotFoundException if the file does not exist or cannot be opened for some reason.</li>
<li><strong>FileOutputStream(String name, boolean append):</strong> This constructor creates a connection to write to the file with the name specified in the argument. If the second argument of the constructor is true, the bytes are written to the end of the file rather than to the beginning of the file. It throws a FileNotFoundException if the file does not exist or cannot be opened for some reason.</li>
<li><strong>FileOutputStream(File  file):</strong>This constructor creates an OutputStream and establishes a connection with the actual file. It throws a FileNotFoundException if the file does not exist or cannot be opened for some reason.</li>
<li><strong>FileOutputStream(File file, boolean append):</strong> This constructor creates an OutputStream and establishes a connection with the actual file. If the second argument of the constructor is true, the bytes are written to the end of the file rather than to the beginning of the file. It throws a FileNotFoundException if the file does not exist or cannot be opened for some reason.</li>
<li><strong>FileOutputStream(FileDescriptor fd Object):</strong><br />
This constructor uses a file descriptor object to write to a specified file. The file descriptor object represents a connection with the existing file.</li>
</ol>
<p>The following code illustrates how to use the file output strem class:</p>
<p><strong>import java.io.*;<br />
 class Forest {<br />
   Forest () {System.out.println (&#8220;1&#8243;); }<br />
   }<br />
   public class Tree extends Forest implements Serializable {<br />
     Tree () { System.out.println(&#8220;2&#8243;);}<br />
     public static void main(String [] args) {<br />
     Tree t = new Tree ();<br />
     try {<br />
       FileOutputStream fos = new FileOutputStream (&#8220;forest.txt&#8221;);<br />
       ObjectOutputStream os = new ObjectOutputStream (fos );<br />
       os.writeObject (t);<br />
       os.close ();<br />
       FileInputStream fis = new FileInputStream(&#8220;forest.txt&#8221;);<br />
       ObjectInputStream is = new ObjectInputStream (fis);<br />
       Tree t1 = (Tree) is.readObject ();<br />
       is.close ();<br />
       } catch (Exception ex) {}<br />
   }<br />
 } </strong>  </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-the-fileoutputstream-class.html&amp;title=What%20is%20the%20FileOutputStream%20class%3F"><img src="http://www.scjp-certification.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.scjp-certification.com/what-is-the-fileoutputstream-class.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

