Mercurial > hg > RemoteEditor > REPSessionManager
diff rep/REPCommandPacker.java @ 382:4b87f89b3afd
REP Session Manager (Java version)
new structure
author | one@firefly.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Mon, 10 Nov 2008 22:07:45 +0900 |
parents | 537a9c6c6d9c |
children | 1fca50ce3508 |
line wrap: on
line diff
--- a/rep/REPCommandPacker.java Mon Nov 10 01:12:46 2008 +0000 +++ b/rep/REPCommandPacker.java Mon Nov 10 22:07:45 2008 +0900 @@ -41,9 +41,7 @@ * @see rep.REPPack#packUConv(rep.REPCommand) */ public ByteBuffer packUConv(REPCommand command){ - int size = 0; - if (command.string!=null) size = command.string.length()*CHARSIZE; - ByteBuffer buffer = ByteBuffer.allocateDirect(HEADER_SIZE+size); + ByteBuffer buffer = ByteBuffer.allocateDirect(HEADER_SIZE+(command.string.length()*CHARSIZE)); buffer.clear(); // position = 0 buffer.putInt(command.cmd.id); buffer.putInt(command.sid);