Mercurial > hg > RemoteEditor > REPSessionManager
comparison rep/REPCommandPacker.java @ 380:537a9c6c6d9c
*** empty log message ***
author | kono |
---|---|
date | Thu, 23 Oct 2008 10:19:04 +0900 |
parents | 5ba5b7a9761b |
children | 4b87f89b3afd |
comparison
equal
deleted
inserted
replaced
379:fa8ca18f74d2 | 380:537a9c6c6d9c |
---|---|
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 ByteBuffer buffer = ByteBuffer.allocateDirect(HEADER_SIZE+(command.string.length()*CHARSIZE)); | 44 int size = 0; |
45 if (command.string!=null) size = command.string.length()*CHARSIZE; | |
46 ByteBuffer buffer = ByteBuffer.allocateDirect(HEADER_SIZE+size); | |
45 buffer.clear(); // position = 0 | 47 buffer.clear(); // position = 0 |
46 buffer.putInt(command.cmd.id); | 48 buffer.putInt(command.cmd.id); |
47 buffer.putInt(command.sid); | 49 buffer.putInt(command.sid); |
48 buffer.putInt(command.eid); | 50 buffer.putInt(command.eid); |
49 buffer.putInt(command.seq); | 51 buffer.putInt(command.seq); |