本实例主要参考的是官网的examples:点击这里
使用场景:客户端向Netty请求一个文件,Netty服务端下载指定位置文件到客户端。
本实例使用的是Http协议,当然,可以通过简单的修改即可换成TCP协议。
需要注意本实例的关键点是,为了更高效的传输大数据,实例中用到了ChunkedWriteHandler编码器,它提供了以zero-memory-copy方式写文件。
第一步:先写一个...
分类:
Web程序 时间:
2014-08-19 12:55:04
阅读次数:
387
最近要写个程序,既有更新的,也有删除的,需要涉及到很多系统表,如果一个表一个表进行更新或者删除太慢了,于是就想通过创建动态内表来实现这些功能,在网上找了一些资料,经过多次尝试,终于测试成功了。网上讲述的创建动态内表的方法大致有两种。我做了一下测试,源代码附后。在这里提醒大家一点,在做动态更新程...
分类:
其他好文 时间:
2014-08-19 12:49:14
阅读次数:
286
前天用递归LTE,昨天用动态规划LTE,今天接着搞,改用贪心法。题目再放一次:'?'匹配任意字符,'*'匹配任意长度字符串Some examples:isMatch("aa","a") → falseisMatch("aa","aa") → trueisMatch("aaa","aa") → fal...
分类:
其他好文 时间:
2014-08-19 00:56:13
阅读次数:
336
Introduction This tutorial will help you to understand about Java OOP’S concepts with examples. Let’s discuss about what are the features of Object Oriented Programming. Writing object-oriented p...
分类:
编程语言 时间:
2014-08-18 23:42:53
阅读次数:
755
java -Xmx256m -Duser.timezone=UTC -Dfile.encoding=UTF-8 -Ddruid.realtime.specFile=examples/indexing/wikipedia.spec -classpath lib/*:config/realtime io...
分类:
其他好文 时间:
2014-08-18 20:09:43
阅读次数:
190
Evaluate the value of an arithmetic expression in Reverse Polish Notation.
Valid operators are +, -, *, /.
Each operand may be an integer or another expression.
Some examples:
["2", "1", ...
分类:
其他好文 时间:
2014-08-18 18:42:42
阅读次数:
215
1. [代码]jsi-rtree-library /****/package com.mycompany.project;//package net.sourceforge.jsi.examples;import java.util.ArrayList;import java.util.List;....
分类:
编程语言 时间:
2014-08-18 18:29:52
阅读次数:
436
源码:https://github.com/Jasig/phpCAS 文档:https://wiki.jasig.org/display/CASC/phpCAS+examples 安 装 ubuntu下使用pear安装 sudo pear install ?http://downloads.jasig.org/cas-clients/php/current.tg...
分类:
Web程序 时间:
2014-08-18 12:41:54
阅读次数:
205