您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 企业文化 > Java入门及例子 (Tomcat, Android, 环境设定)
龙高大老的博客文章作者:yutiansky做最棒的软件开发交流社区第1/79页本书由JavaEye提供的电子书DIY功能自动生成于2011-02-15目录1.Java编程1.1(java入门)禁止标准输出...........................................................41.2(java入门)BASE64&序列化.......................................................51.3(java入门)ThreadLocalSample....................................................81.4(java入门)Apache的SharedPoolDataSource例子....................................111.5(java入门)tomcat的webapps加载调查.............................................131.6(java入门)MyLog..............................................................151.7(java入门)内存消耗的调查........................................................171.8(Axis2入门)SamplePOJO.......................................................191.9(Axis2入门)SampleJAX-WS异步Client...........................................221.10(Axis2入门)SampleJAX-WSClient..............................................251.11(tomcat入门)TomcatRemoteDebug............................................261.12(tomcat中级)应用Tomcat的WebappClassLoader加载指定目录的jar文件................271.13(Struts2)OGNL笔记#的用法一.....................................................301.14(Struts2)OGNL笔记#的用法二.....................................................311.15(Struts2)OGNL笔记#的用法三.....................................................321.16apache.poj的例子(1)...........................................................341.17apache.poj的例子(2)...........................................................421.18(log4j入门)举例说明log4j的配置文件.............................................461.19(ldap入门)连接&检索..........................................................49页1.20SpringFrameworkResourceBundleMessageSource调查..............................511.21Cobertura笔记..................................................................521.22derby+myBatis入门.............................................................542.Android编程2.1Android,画个钟看看..............................................................582.2Android中用Socket的小例子........................................................613.编程环境3.1(ant入门)用Ant生成Jar文件时在manifest中加入打包时间..............................643.2(ant入门)Import&Copy........................................................653.3(ant入门)AntCall...............................................................673.4(nant入门)Framework3.5对应...................................................683.5搭建环境Eclipse+MinGW+pthread...............................................704.其他知识4.1XP科普常用Batch命令.............................................................724.2XP科普Explorer的CMD通道........................................................734.3ORACLE的TRACE取得方法..........................................................744.4VmWare使用注意点...............................................................764.5ubuntu下驱动程序的helloworld....................................................77页1.1(java入门)禁止标准输出发表时间:2009-05-19packagenet.tianyu.test;importjava.io.ByteArrayOutputStream;importjava.io.IOException;importjava.io.OutputStream;importjava.io.PrintStream;publicclassMyStdOutManagerextendsByteArrayOutputStream{privatestaticPrintStreamstdout_;publicvoidwrite(byte[]b,intoff,intlen){}publicvoidwriteTo(OutputStreamout)throwsIOException{}publicstaticvoidmain(String[]args){stdout_=System.out;ByteArrayOutputStreambuf=newMyStdOutManager();System.setOut(newPrintStream(buf));for(inti=0;i1000;i++){System.out.println(nooutput);}stdout_.println(5);}}(java入门)禁止标准输出第4/79页1.2(java入门)BASE64&序列化发表时间:2009-05-24关键字:base64序列化结论:序列化比BASE64消耗多packagenet.tianyu.sample;importjava.io.ByteArrayInputStream;importjava.io.ByteArrayOutputStream;importjava.io.ObjectInputStream;importjava.io.ObjectOutputStream;importjava.io.Serializable;importorg.apache.commons.codec.binary.Base64;publicclassTestSerializeimplementsSerializable{privatestaticfinallongserialVersionUID=282679798530248147L;privatestaticfinalStringENCODE_CHART_SET=UTF-8;privatestaticfinallongTEST_COUNT=500;publicstaticvoidmain(String[]args)throwsException{for(inti=0;i100;i++){System.out.println(----------teststart----------+newInteger(i));testSerialize();testBase64();}}privatestaticvoidtestBase64()throwsException{TreeBeantree=newTreeBean();Stringbytes;longstartTime=System.currentTimeMillis();for(inti=0;iTEST_COUNT;i++){(java入门)BASE64&序列化第5/79页bytes=getStringFromObject(tree);getObjectFromString(bytes);}longendTime=System.currentTimeMillis();System.out.println(testBase64:+(endTime-startTime));}privatestaticvoidtestSerialize()throwsException{TreeBeantree=newTreeBean();byte[]bytes;longstartTime=System.currentTimeMillis();for(inti=0;iTEST_COUNT;i++){bytes=getByteArrayFromObject(tree);getObjectFromByteArray(bytes);}longendTime=System.currentTimeMillis();System.out.println(testSerialize:+(endTime-startTime));}privatestaticObjectgetObjectFromString(StringobjectString)throwsException{if(objectString==null||objectString.trim().length()==0){returnnull;}Base64base64Deco
本文标题:Java入门及例子 (Tomcat, Android, 环境设定)
链接地址:https://www.777doc.com/doc-4304239 .html