comparison 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
comparison
equal deleted inserted replaced
381:65fdb3dc1885 382:4b87f89b3afd
39 39
40 /* (non-Javadoc) 40 /* (non-Javadoc)
41 * @see rep.REPPack#packUConv(rep.REPCommand) 41 * @see rep.REPPack#packUConv(rep.REPCommand)
42 */ 42 */
43 public ByteBuffer packUConv(REPCommand command){ 43 public ByteBuffer packUConv(REPCommand command){
44 int size = 0; 44 ByteBuffer buffer = ByteBuffer.allocateDirect(HEADER_SIZE+(command.string.length()*CHARSIZE));
45 if (command.string!=null) size = command.string.length()*CHARSIZE;
46 ByteBuffer buffer = ByteBuffer.allocateDirect(HEADER_SIZE+size);
47 buffer.clear(); // position = 0 45 buffer.clear(); // position = 0
48 buffer.putInt(command.cmd.id); 46 buffer.putInt(command.cmd.id);
49 buffer.putInt(command.sid); 47 buffer.putInt(command.sid);
50 buffer.putInt(command.eid); 48 buffer.putInt(command.eid);
51 buffer.putInt(command.seq); 49 buffer.putInt(command.seq);