<?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>Jiramot.info &#187; groovy</title>
	<atom:link href="http://www.jiramot.info/tag/groovy/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jiramot.info</link>
	<description>Developer&#039;s Life</description>
	<lastBuildDate>Mon, 06 Feb 2012 08:49:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Object serialization in groovy</title>
		<link>http://www.jiramot.info/object-serialization-in-groovy</link>
		<comments>http://www.jiramot.info/object-serialization-in-groovy#comments</comments>
		<pubDate>Wed, 18 Mar 2009 04:10:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.jiramot.info/?p=225</guid>
		<description><![CDATA[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 // put this in a file named Name.groovy and compile using groovyc class Name implements Serializable &#123; def fname, lname &#125; // Now run the code below to see the Object serialization and de-serialization. def [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// put this in a file named Name.groovy and compile using groovyc </span>
<span style="color: #000000; font-weight: bold;">class</span> <span style="color: #003399;">Name</span> <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399;">Serializable</span>  <span style="color: #009900;">&#123;</span>
   def fname, lname
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// Now run the code below to see the Object serialization and de-serialization.</span>
def test1<span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Name</span><span style="color: #009900;">&#40;</span>fname<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;fn1&quot;</span>, lname <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;ln1&quot;</span><span style="color: #009900;">&#41;</span>
def test2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Name</span><span style="color: #009900;">&#40;</span>fname<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;fn2&quot;</span>, lname<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;ln2&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #666666; font-style: italic;">//serialization</span>
<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;C:/config.txt&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">withObjectOutputStream</span> <span style="color: #009900;">&#123;</span> out <span style="color: #339933;">-&gt;</span>
    out <span style="color: #339933;">&lt;&lt;</span> test1
    out <span style="color: #339933;">&lt;&lt;</span> test2
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//de-serialization</span>
<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;C:/config.txt&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">withObjectInputStream</span> <span style="color: #009900;">&#123;</span> instream <span style="color: #339933;">-&gt;</span>
    instream.<span style="color: #006633;">eachObject</span> <span style="color: #009900;">&#123;</span> 
        println it
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Source: <a target="_blank" rel="nofollow" href="http://www.jiramot.info/goto/http://satish.name/?p=66" >satish.name</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiramot.info/object-serialization-in-groovy/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

