<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Lesson learned: copying bytes from an OutputStream to an InputStream in Weblogic 8</title>
	<atom:link href="http://www.mooreds.com/wordpress/archives/277/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mooreds.com/wordpress/archives/277</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 14:11:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Carl Smotricz</title>
		<link>http://www.mooreds.com/wordpress/archives/277/comment-page-1#comment-2320</link>
		<dc:creator>Carl Smotricz</dc:creator>
		<pubDate>Sun, 16 Nov 2008 13:26:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.mooreds.com/wordpress/?p=277#comment-2320</guid>
		<description>oops... code in comment mangled by HTML. One more try:&lt;code&gt;
while (true) {
&#160;&#160;int count = bis.read(data);
&#160;&#160;if (count &lt; 0) break;
&#160;&#160;bos.write(data, 0, count);
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>oops&#8230; code in comment mangled by HTML. One more try:<code><br />
while (true) {<br />
&nbsp;&nbsp;int count = bis.read(data);<br />
&nbsp;&nbsp;if (count &lt; 0) break;<br />
&nbsp;&nbsp;bos.write(data, 0, count);<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carl Smotricz</title>
		<link>http://www.mooreds.com/wordpress/archives/277/comment-page-1#comment-2319</link>
		<dc:creator>Carl Smotricz</dc:creator>
		<pubDate>Sun, 16 Nov 2008 13:23:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.mooreds.com/wordpress/?p=277#comment-2319</guid>
		<description>This post is over 3 years old, but I thought I&#039;d respond anyway and clear up the problem.

In the code fragment above, Dan ignores the data count from bis.read() . Depending on the size of the text, the last call to read() will almost never read exactly 1024 bytes. My preferred solution is:&lt;code&gt;
while (true) {
   int count = bis.read(data);
   if (count &lt;/code&gt;

The solutions quoted from the cookbook and tutorial have a performance problem: The read() and write() methods, as well as the underlying operating system calls, are repeated for each byte. With megabytes of data, we&#039;d be talking a lot of unnecessary overhead. Buffering is good!</description>
		<content:encoded><![CDATA[<p>This post is over 3 years old, but I thought I&#8217;d respond anyway and clear up the problem.</p>
<p>In the code fragment above, Dan ignores the data count from bis.read() . Depending on the size of the text, the last call to read() will almost never read exactly 1024 bytes. My preferred solution is:<code><br />
while (true) {<br />
   int count = bis.read(data);<br />
   if (count </code></p>
<p>The solutions quoted from the cookbook and tutorial have a performance problem: The read() and write() methods, as well as the underlying operating system calls, are repeated for each byte. With megabytes of data, we&#8217;d be talking a lot of unnecessary overhead. Buffering is good!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- This Quick Cache file was built for (  www.mooreds.com/wordpress/archives/277/feed ) in 0.19921 seconds, on Feb 8th, 2012 at 9:20 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 8th, 2012 at 10:20 pm UTC -->
