Netty_Game_Demo
DEMO netty 

所属分类:Windows编程
开发工具:Java
文件大小:1442KB
下载次数:6
上传日期:2014-03-06 23:18:42
上 传 者逍遥游123
说明:  Netty_Game_Demo.rar是Netty推出的最新资源,这是一个实例。
(This is a demo for netty)

文件列表:
Netty_Game_Demo\.classpath (2752, 2012-07-12)
Netty_Game_Demo\.project (389, 2012-07-12)
Netty_Game_Demo\.settings\org.eclipse.core.resources.prefs (82, 2012-07-12)
Netty_Game_Demo\bin\com\cp\game\domain\MessageQueue.class (1411, 2012-07-12)
Netty_Game_Demo\bin\com\cp\game\GameHandler.class (267, 2012-07-12)
Netty_Game_Demo\bin\com\cp\game\GameRunTimeException.class (1529, 2012-07-12)
Netty_Game_Demo\bin\com\cp\game\handler\common\InitHandler.class (1455, 2012-07-12)
Netty_Game_Demo\bin\com\cp\game\HandlerDispatcher$MessageWorker.class (3587, 2012-07-12)
Netty_Game_Demo\bin\com\cp\game\HandlerDispatcher.class (4712, 2012-07-12)
Netty_Game_Demo\bin\com\cp\game\ServerMainHandler.class (1306, 2012-07-12)
Netty_Game_Demo\bin\com\cp\netty\coder\Decoder.class (958, 2012-07-12)
Netty_Game_Demo\bin\com\cp\netty\coder\Encoder.class (2111, 2012-07-12)
Netty_Game_Demo\bin\com\cp\netty\domain\Command.class (2989, 2012-07-12)
Netty_Game_Demo\bin\com\cp\netty\domain\FiexThreadPoolExecutor.class (1102, 2012-07-12)
Netty_Game_Demo\bin\com\cp\netty\domain\GameRequest.class (2539, 2012-07-12)
Netty_Game_Demo\bin\com\cp\netty\domain\GameResponse.class (3576, 2012-07-12)
Netty_Game_Demo\bin\com\cp\netty\domain\IGameRequest.class (340, 2012-07-12)
Netty_Game_Demo\bin\com\cp\netty\domain\IGameResponse.class (315, 2012-07-12)
Netty_Game_Demo\bin\com\cp\netty\ServerHandler.class (3966, 2012-07-12)
Netty_Game_Demo\bin\com\cp\netty\ServerPipelineFactory.class (1305, 2012-07-12)
Netty_Game_Demo\bin\com\cp\ServerTest.class (1888, 2012-07-12)
Netty_Game_Demo\bin\com\cp\test\ClientHandler.class (4104, 2012-07-12)
Netty_Game_Demo\bin\com\cp\test\ClientPipelineFactory.class (1024, 2012-07-12)
Netty_Game_Demo\bin\com\cp\test\ClientTest.class (1652, 2012-07-12)
Netty_Game_Demo\bin\com\cp\test\CopyOfClientTest.class (1718, 2012-07-12)
Netty_Game_Demo\bin\com\cp\utils\StreamUtils.class (10502, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\bootstrap\Bootstrap.class (15391, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\bootstrap\ClientBootstrap.class (2634, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\bootstrap\ConnectionlessBootstrap.class (3858, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\bootstrap\package-info.class (131, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\bootstrap\ServerBootstrap$Binder.class (4784, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\bootstrap\ServerBootstrap.class (4502, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\buffer\AbstractChannelBuffer.class (17132, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\buffer\AbstractChannelBufferFactory.class (1359, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\buffer\BigEndianHeapChannelBuffer.class (3034, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\buffer\ByteBufferBackedChannelBuffer.class (8337, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\buffer\ChannelBuffer.class (4536, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\buffer\ChannelBufferFactory.class (533, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\buffer\ChannelBufferIndexFinder$1.class (770, 2012-07-12)
Netty_Game_Demo\bin\org\jboss\netty\buffer\ChannelBufferIndexFinder$10.class (807, 2012-07-12)
... ...

改两个方法后,代码运行ok 1.private void _writeData(long aValue, int aLength) { 2. if (writepos + aLength > buffer.length) { 3. _expand(writepos + aLength + 100); 4. } 5. int tmp = (aLength - 1) * 8; 6. while (tmp >= 0) { 7. buffer[writepos++] = (byte) ((aValue >> tmp) & 0xFF); 8. tmp -= 8; 9. } 10. size += aLength; 11.} 1.public static int readInt(InputStream in) throws IOException { 2. int b0 = readByte(in); 3. int b1 = readByte(in); 4. int b2 = readByte(in); 5. int b3 = readByte(in); 6. return ((b0 & 0xFF) << 24) | ((b1 & 0xFF) << 16) | ((b2 & 0xFF) << 8) | (b3 & 0xFF); 7.}

近期下载者

相关文件


收藏者