<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feeds.feedsky.com/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feeds.feedsky.com/csdn.net/hotdust" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feeds.feedsky.com/csdn.net/hotdust" type="application/rss+xml"></fs:self_link><lastBuildDate>Tue, 11 Aug 2009 15:39:00 GMT</lastBuildDate><title>冲吧，不要停！</title><description>怎么java又来了？</description><link>http://blog.csdn.net/hotdust/</link><item><title>基于Struts FormFile上传文件</title><link>http://blog.csdn.net/hotdust/archive/2009/08/11/4434809.aspx</link><wfw:comment>http://blog.csdn.net/hotdust/comments/4434809.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/hotdust/comments/commentRss/4434809.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4434809</trackback:ping><description>&lt;br /&gt;权所有，欢迎转载，转载请注明转自http://www.suneca.com&lt;br /&gt;&lt;br /&gt;      有关文件上传的控件可能非常多，比如有用于学习的SmartUpload、性能非常好的COS组件、有Apache的FileUpload组件、有Struts的FormFile组件、有Spring上传文件，还有其他一些开发的控件等等。假如你是用Struts，那基于Struts FormFile组件应该是一个不错的选择。&lt;br /&gt;      Struts FormFile跟Struts ActionForm结合得非常好，使用起来也非常简单，但是，对于同时上传多个附件，那就有点麻烦了！不管怎么样，它还是一个好东西，关键看大家怎么看待他了！&lt;br /&gt;      第一步，我们创建一个新的Struts工程，创建一个FileUploadForm，FileUploadForm如下所示： 程序代码package zizz.struts;&lt;br /&gt;&lt;br /&gt;import org.apache.struts.action.ActionForm;&lt;br /&gt;import org.apac&lt;img src =&quot;http://blog.csdn.net/hotdust/aggbug/4434809.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/257462596/hotdust/csdn.net/s.gif?r=http://blog.csdn.net/hotdust/archive/2009/08/11/4434809.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/hotdust/257462596/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/hotdust/257462596/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Tue, 11 Aug 2009 23:39:00 +0800</pubDate><author>hotdust</author><comments>http://blog.csdn.net/hotdust/archive/2009/08/11/4434809.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/hotdust/archive/2009/08/11/4434809.aspx</guid><dc:creator>hotdust</dc:creator><fs:srclink>http://blog.csdn.net/hotdust/archive/2009/08/11/4434809.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/hotdust/rss.aspx</fs:srcfeed><fs:itemid>csdn.net/hotdust/~1322699/257462596/1327215</fs:itemid></item><item><title>利用JAVA API函数实现数据的压缩与解压缩</title><link>http://blog.csdn.net/hotdust/archive/2009/08/11/4432810.aspx</link><wfw:comment>http://blog.csdn.net/hotdust/comments/4432810.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/hotdust/comments/commentRss/4432810.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4432810</trackback:ping><description>时间: 2004-04-12 本文通过对数据压缩算法的简要介绍，然后以详细的示例演示了利用java.util.zip包实现数据的压缩与解压，并扩展到在网络传输方面如何应用java.util.zip包现数据压缩与解压&lt;br /&gt;综述&lt;br /&gt;许多信息资料都或多或少的包含一些多余的数据。通常会导致在客户端与服务器之间，应用程序与计算机之间极大的数据传输量。最常见的解决数据存储和信息传送的方法是安装额外的存储设备和扩展现有的通讯能力。这样做是可以的，但无疑会增加组织的运作成本。一种有效的解决数据存储与信息传输的方法是通过更有效率的代码来存储数据。这篇文章简要的介绍了数据的压缩与解压缩，并展示了用java.util.zip包来实现数据的压缩与解压缩是多么的方便与高效。&lt;br /&gt;当然用诸如WinZip，gzip，和Java压缩（或jar）之类的工具也可以实现数据的压缩与解压缩，这些工具都是独立的应用程序。你也可以在JAVA应用程序中调用这些工具，但这并不是最直接的方法，也不是有效的解决方法。尤其是你想更快速地实现数据的压缩与解压缩（例如在传输数据到远程机器之前）。这篇文章包括以下内容：给出一&lt;img src =&quot;http://blog.csdn.net/hotdust/aggbug/4432810.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/257462597/hotdust/csdn.net/s.gif?r=http://blog.csdn.net/hotdust/archive/2009/08/11/4432810.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/hotdust/257462597/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/hotdust/257462597/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Tue, 11 Aug 2009 17:45:00 +0800</pubDate><author>hotdust</author><comments>http://blog.csdn.net/hotdust/archive/2009/08/11/4432810.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/hotdust/archive/2009/08/11/4432810.aspx</guid><dc:creator>hotdust</dc:creator><fs:srclink>http://blog.csdn.net/hotdust/archive/2009/08/11/4432810.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/hotdust/rss.aspx</fs:srcfeed><fs:itemid>csdn.net/hotdust/~1322699/257462597/1327215</fs:itemid></item><item><title>XXXX项目hibernate与应用缓存方案总结</title><link>http://blog.csdn.net/hotdust/archive/2009/08/10/4430692.aspx</link><wfw:comment>http://blog.csdn.net/hotdust/comments/4430692.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/hotdust/comments/commentRss/4430692.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4430692</trackback:ping><description>&lt;br /&gt;XXXX项目是目前在实际工作中正在做的事情，该项目是一个大型系统的内容管理内核，负责最核心的meta data的集中管理，性能有较高的要求，设计初期就要求能够支持cluster。项目使用hibernate 3.2，针对开发过程中对于各种缓存的不同看法，撰写了本文。重点在于澄清一些hibernate的缓存细节，纠正一些错误的缓存用法。&lt;br /&gt;  XXXX项目缓存方案总结        XXXX项目是目前在实际工作中正在做的事情，该项目是一个大型系统的内容管理内核，负责最核心的meta data的集中管理，性能有较高的要求，设计初期就要求能够支持cluster。项目使用hibernate 3.2，针对开发过程中对于各种缓存的不同看法，撰写了本文。重点在于澄清一些hibernate的缓存细节，纠正一些错误的缓存用法。 一、hibernate的二级缓存       如果开启了二级缓存，hibernate在执行任何一次查询的之后，都会把得到的结果集放到缓存中，缓存结构可以看作是一个hash table，key是数据库记录的id，value是id对应的pojo对象。当用户根据id查&lt;img src =&quot;http://blog.csdn.net/hotdust/aggbug/4430692.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/257462598/hotdust/csdn.net/s.gif?r=http://blog.csdn.net/hotdust/archive/2009/08/10/4430692.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/hotdust/257462598/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/hotdust/257462598/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 10 Aug 2009 22:29:00 +0800</pubDate><author>hotdust</author><comments>http://blog.csdn.net/hotdust/archive/2009/08/10/4430692.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/hotdust/archive/2009/08/10/4430692.aspx</guid><dc:creator>hotdust</dc:creator><fs:srclink>http://blog.csdn.net/hotdust/archive/2009/08/10/4430692.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/hotdust/rss.aspx</fs:srcfeed><fs:itemid>csdn.net/hotdust/~1322699/257462598/1327215</fs:itemid></item><item><title>数据库对象的缓存策略</title><link>http://blog.csdn.net/hotdust/archive/2009/08/10/4430689.aspx</link><wfw:comment>http://blog.csdn.net/hotdust/comments/4430689.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/hotdust/comments/commentRss/4430689.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4430689</trackback:ping><description>&lt;br /&gt;前言 &lt;br /&gt;本文探讨Jive(曾经开源的Java论坛)和Hibernate（Java开源持久层）的数据库对象的缓存策略，并阐述作者本人的Lightor（Java开源持久层）采用的数据库对象缓存策略。 &lt;br /&gt;本文的探讨基于以前开源的Jive代码，Hibernate2.1.7源码，和作者本人的Lightor代码。 &lt;br /&gt;本文用ID (Identifier的缩写)来代表数据记录的关键字。 &lt;br /&gt;数据对象查询一般分为两种：条件查询，返回一个满足条件的数据对象列表； ID查询，返回ID对应的数据对象。 &lt;br /&gt;本文主要探讨“条件查询”和“ID查询”这两种情况的缓存策略。 &lt;br /&gt;本文只探讨一个JVM内的数据缓存策略，不涉及分布式缓存；本文只探讨对应单表的数据对象的缓存，不涉及关联表对象的情况。 &lt;br /&gt;&lt;br /&gt;一、Jive的缓存策略 &lt;br /&gt;1．Jive的缓存策略的过程描述： &lt;br /&gt;(1)条件查询的时候，Jive用 select id from table_name where …. （只选择ID字段）这样的SQL语句查询数据库，来获&lt;img src =&quot;http://blog.csdn.net/hotdust/aggbug/4430689.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/257462599/hotdust/csdn.net/s.gif?r=http://blog.csdn.net/hotdust/archive/2009/08/10/4430689.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/hotdust/257462599/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/hotdust/257462599/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 10 Aug 2009 22:28:00 +0800</pubDate><author>hotdust</author><comments>http://blog.csdn.net/hotdust/archive/2009/08/10/4430689.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/hotdust/archive/2009/08/10/4430689.aspx</guid><dc:creator>hotdust</dc:creator><fs:srclink>http://blog.csdn.net/hotdust/archive/2009/08/10/4430689.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/hotdust/rss.aspx</fs:srcfeed><fs:itemid>csdn.net/hotdust/~1322699/257462599/1327215</fs:itemid></item><item><title>hibernate二级缓存攻略</title><link>http://blog.csdn.net/hotdust/archive/2009/08/10/4430673.aspx</link><wfw:comment>http://blog.csdn.net/hotdust/comments/4430673.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/hotdust/comments/commentRss/4430673.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4430673</trackback:ping><description>相关文章:  Hibernate缓存机制细谈Ehcache页面缓存的使用怎样判断对象是否存在于缓存中&lt;br /&gt;推荐圈子: JBoss SEAM&lt;br /&gt;更多相关推荐&lt;br /&gt;
很多人对二级缓存都不太了解，或者是有错误的认识，我一直想写一篇文章介绍一下hibernate的二级缓存的，今天终于忍不住了。 &lt;br /&gt;我的经验主要来自hibernate2.1版本，基本原理和3.0、3.1是一样的，请原谅我的顽固不化。 &lt;br /&gt;&lt;br /&gt;hibernate的session提供了一级缓存，每个session，对同一个id进行两次load，不会发送两条sql给数据库，但是session关闭的时候，一级缓存就失效了。 &lt;br /&gt;&lt;br /&gt;二级缓存是SessionFactory级别的全局缓存，它底下可以使用不同的缓存类库，比如ehcache、oscache等，需要设置hibernate.cache.provider_class，我们这里用ehcache，在2.1中就是 &lt;br /&gt;hibernate.cache.provider_class=net.sf.hibernate.cach&lt;img src =&quot;http://blog.csdn.net/hotdust/aggbug/4430673.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/257462600/hotdust/csdn.net/s.gif?r=http://blog.csdn.net/hotdust/archive/2009/08/10/4430673.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/hotdust/257462600/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/hotdust/257462600/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 10 Aug 2009 22:23:00 +0800</pubDate><author>hotdust</author><comments>http://blog.csdn.net/hotdust/archive/2009/08/10/4430673.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/hotdust/archive/2009/08/10/4430673.aspx</guid><dc:creator>hotdust</dc:creator><fs:srclink>http://blog.csdn.net/hotdust/archive/2009/08/10/4430673.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/hotdust/rss.aspx</fs:srcfeed><fs:itemid>csdn.net/hotdust/~1322699/257462600/1327215</fs:itemid></item><item><title>基于hibernate缓存机制的查询性能优化研究</title><link>http://blog.csdn.net/hotdust/archive/2009/08/10/4430642.aspx</link><wfw:comment>http://blog.csdn.net/hotdust/comments/4430642.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/hotdust/comments/commentRss/4430642.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4430642</trackback:ping><description>&lt;br /&gt;Hibernate是一个面向JAVA环境的对象/关系数据库映射工具，它对JDBC进行了非常轻量级的对象封装，使得Java程序员可以随心所欲的使用面向对象编程思维来操纵关系数据库。对象/关系映射（Object/ Relational Mapping，简称ORM）把对象模型表示的对象映射到基于SQL的关系模型结构中去，使得Hibernate可以应用在任何使用JDBC的场合，可以应用到EJB的J2EE架构中，以取代CMP完成数据持久化的重任，也可以整合到J2EE系统中作为持久层框架。 &lt;br /&gt;　　缓存是数据库数据在内存中的临时容器，它包含了库表数据在内存中的临时拷贝，位于数据库与数据访问层之间，其作用是为了降低应用程序对物理数据源访问的频次，从而提高应用的运行性能。 &lt;br /&gt;　　相对内存操作，数据库调用是一个代价高昂的过程，然而典型企业级应用结构，数据库往往和应用服务器位于不同的物理服务器，这就意味着每次数据库访问都是一次远程调用，数据的打包拆包，网络传输上的延时等消耗都给网络整体性能造成了严重影响。此时，本地内存中的数据缓存的存在价值就显得特别突出。 &lt;br /&gt;　　对&lt;img src =&quot;http://blog.csdn.net/hotdust/aggbug/4430642.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/257462601/hotdust/csdn.net/s.gif?r=http://blog.csdn.net/hotdust/archive/2009/08/10/4430642.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/hotdust/257462601/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/hotdust/257462601/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 10 Aug 2009 22:14:00 +0800</pubDate><author>hotdust</author><comments>http://blog.csdn.net/hotdust/archive/2009/08/10/4430642.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/hotdust/archive/2009/08/10/4430642.aspx</guid><dc:creator>hotdust</dc:creator><fs:srclink>http://blog.csdn.net/hotdust/archive/2009/08/10/4430642.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/hotdust/rss.aspx</fs:srcfeed><fs:itemid>csdn.net/hotdust/~1322699/257462601/1327215</fs:itemid></item><item><title>使用urlconnection下载文件或图片并保存到本地</title><link>http://blog.csdn.net/hotdust/archive/2009/08/05/4410714.aspx</link><wfw:comment>http://blog.csdn.net/hotdust/comments/4410714.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/hotdust/comments/commentRss/4410714.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4410714</trackback:ping><description>import java.io.FileOutputStream;   import java.io.InputStream;   import java.io.OutputStream;   import java.net.URL;   import java.net.URLConnection;     /**   * 使用URLConnection下载文件或图片并保存到本地。   *    * @author 老紫竹(laozizhu.com)   */  public class URLConnectionDownloader {       public static void main(String[] args) throws Exception {       download(&quot;http://www.laozizhu.com/images/logo.gif&quot;, &quot;laozizhu.com.gif&quot;);     }       /**     * 下载文件到本地     *      * @param urlString     *          被下载的文件地址  &lt;img src =&quot;http://blog.csdn.net/hotdust/aggbug/4410714.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/257462602/hotdust/csdn.net/s.gif?r=http://blog.csdn.net/hotdust/archive/2009/08/05/4410714.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/hotdust/257462602/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/hotdust/257462602/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Wed, 05 Aug 2009 18:03:00 +0800</pubDate><author>hotdust</author><comments>http://blog.csdn.net/hotdust/archive/2009/08/05/4410714.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/hotdust/archive/2009/08/05/4410714.aspx</guid><dc:creator>hotdust</dc:creator><fs:srclink>http://blog.csdn.net/hotdust/archive/2009/08/05/4410714.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/hotdust/rss.aspx</fs:srcfeed><fs:itemid>csdn.net/hotdust/~1322699/257462602/1327215</fs:itemid></item><item><title>比较一下java写文本文件文件的性能</title><link>http://blog.csdn.net/hotdust/archive/2009/08/05/4410694.aspx</link><wfw:comment>http://blog.csdn.net/hotdust/comments/4410694.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/hotdust/comments/commentRss/4410694.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4410694</trackback:ping><description>比较一下java写文本文件文件的性能&lt;br /&gt;关键字: java&lt;br /&gt;比较一下java写文本文件文件的性能&lt;br /&gt;    最近对以前开发的一个通用数据迁移的软件进行优化。除了用JDK5.0的多线程技术进行的改进之外，也比较了一下java写文件的性能。&lt;br /&gt;    在java写文件中，通常会使用FileOutputStream和FileWriter，FileWriter只能写文本文件。FileOutputStream也经常结合BufferedOutputStream。因为实际应用中写文本文件的情况占了大多数。所以下面测试用不同的方式生成一个相同行数、大小相同的文件的三种不同方式。&lt;br /&gt;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.io.FileOutputStream;&lt;br /&gt;import java.io.*;&lt;br /&gt;public class FileTest {&lt;br /&gt;    public FileTest() {&lt;br /&gt;    }&lt;br /&gt;    public static void main&lt;img src =&quot;http://blog.csdn.net/hotdust/aggbug/4410694.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/257462603/hotdust/csdn.net/s.gif?r=http://blog.csdn.net/hotdust/archive/2009/08/05/4410694.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/hotdust/257462603/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/hotdust/257462603/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Wed, 05 Aug 2009 18:01:00 +0800</pubDate><author>hotdust</author><comments>http://blog.csdn.net/hotdust/archive/2009/08/05/4410694.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/hotdust/archive/2009/08/05/4410694.aspx</guid><dc:creator>hotdust</dc:creator><fs:srclink>http://blog.csdn.net/hotdust/archive/2009/08/05/4410694.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/hotdust/rss.aspx</fs:srcfeed><fs:itemid>csdn.net/hotdust/~1322699/257462603/1327215</fs:itemid></item><item><title>写文件时要使用OutputStream.write(buff, off, len)</title><link>http://blog.csdn.net/hotdust/archive/2009/08/05/4410606.aspx</link><wfw:comment>http://blog.csdn.net/hotdust/comments/4410606.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/hotdust/comments/commentRss/4410606.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4410606</trackback:ping><description>&lt;br /&gt;在写文件时，一定要使用OutputStream.write(buff, off, len)，如果用OutputStream.write(buff)的话，会把文件写的比原文件大，造成文件内容不正确。（如，写图片时容易造成图片失真）。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;byte[] buff = new byte[512];    &lt;br /&gt;int len = -1;&lt;br /&gt;while( ( len = in.read( buff ) ) != -1 ){&lt;br /&gt;       out.write(buff, 0, len);&lt;br /&gt;}&lt;img src =&quot;http://blog.csdn.net/hotdust/aggbug/4410606.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/257462604/hotdust/csdn.net/s.gif?r=http://blog.csdn.net/hotdust/archive/2009/08/05/4410606.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/hotdust/257462604/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/hotdust/257462604/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Wed, 05 Aug 2009 17:41:00 +0800</pubDate><author>hotdust</author><comments>http://blog.csdn.net/hotdust/archive/2009/08/05/4410606.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/hotdust/archive/2009/08/05/4410606.aspx</guid><dc:creator>hotdust</dc:creator><fs:srclink>http://blog.csdn.net/hotdust/archive/2009/08/05/4410606.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/hotdust/rss.aspx</fs:srcfeed><fs:itemid>csdn.net/hotdust/~1322699/257462604/1327215</fs:itemid></item><item><title>细说HTML元素的ID和Name属性的区别</title><link>http://blog.csdn.net/hotdust/archive/2009/06/02/4235066.aspx</link><wfw:comment>http://blog.csdn.net/hotdust/comments/4235066.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/hotdust/comments/commentRss/4235066.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4235066</trackback:ping><description>&lt;br /&gt;可以说几乎每个做过Web开发的人都问过，到底元素的ID和Name有什么区别阿？为什么有了ID还要有Name呢?! 而同样我们也可以得到最classical的答案：ID就像是一个人的身份证号码，而Name就像是他的名字，ID显然是唯一的，而Name是可以重复的。&lt;br /&gt;&lt;br /&gt;    上周我也遇到了ID和Name的问题，在页面里输入了一个input type=&quot;hidden&quot;，只写了一个ID='SliceInfo'，赋值后submit，在后台用Request.Params[&quot;SliceInfo&quot;]却怎么也去不到值。后来恍然大悟因该用Name来标示，于是在input里加了个Name='SliceInfo'，就一切ok了。&lt;br /&gt;&lt;br /&gt;    第一段里对于ID和Name的解答说的太笼统了，当然那个解释对于ID来说是完全对的，它就是Client端HTML元素的Identity。而Name其实要复杂的多，因为Name有很多种的用途，所以它并不能完全由ID来代替，从而将其取消掉。具体用途有：&lt;br /&gt;&lt;br /&gt;    用途1: 作为可与服务器交互数据的HTML元素&lt;img src =&quot;http://blog.csdn.net/hotdust/aggbug/4235066.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/257462605/hotdust/csdn.net/s.gif?r=http://blog.csdn.net/hotdust/archive/2009/06/02/4235066.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/hotdust/257462605/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/hotdust/257462605/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Tue, 02 Jun 2009 18:25:00 +0800</pubDate><author>hotdust</author><comments>http://blog.csdn.net/hotdust/archive/2009/06/02/4235066.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/hotdust/archive/2009/06/02/4235066.aspx</guid><dc:creator>hotdust</dc:creator><fs:srclink>http://blog.csdn.net/hotdust/archive/2009/06/02/4235066.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/hotdust/rss.aspx</fs:srcfeed><fs:itemid>csdn.net/hotdust/~1322699/257462605/1327215</fs:itemid></item></channel></rss>