We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Description: A simple, asynchronous, single-threaded memcached client written in java.
Homepage: http://code.google.com/p/spymemcached/
Clone URL: git://github.com/dustin/java-memcached-client.git
Binary protocol provides a binary response now.
dustin (author)
Thu Jan 17 22:59:56 -0800 2008
commit  83ef0df9caea4b8343d5bf6ede773d6789298e0e
tree    904859c2e8d4df174a096fd412d93d8d74412579
parent  3da5ec40a719be9a079387a0ddec0f5dc2fb38a3
...
49
50
51
52
 
53
54
55
...
49
50
51
 
52
53
54
55
0
@@ -49,7 +49,7 @@ public class MutatorOperationImpl extends OperationImpl implements
0
   @Override
0
   protected void decodePayload(byte[] pl) {
0
     getCallback().receivedStatus(new OperationStatus(true,
0
- new String(pl)));
0
+ String.valueOf(decodeLong(pl, 0))));
0
   }
0
 
0
 }
...
189
190
191
 
 
 
 
 
 
 
 
 
 
 
192
193
194
...
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
0
@@ -189,6 +189,17 @@ abstract class OperationImpl extends BaseOperationImpl {
0
       | (data[i+3] & 0xff);
0
   }
0
 
0
+ static long decodeLong(byte[] data, int i) {
0
+ return(data[i ] & 0xff) << 56
0
+ | (data[i+1] & 0xff) << 48
0
+ | (data[i+2] & 0xff) << 40
0
+ | (data[i+3] & 0xff) << 32
0
+ | (data[i+4] & 0xff) << 24
0
+ | (data[i+5] & 0xff) << 16
0
+ | (data[i+6] & 0xff) << 8
0
+ | (data[i+7] & 0xff);
0
+ }
0
+
0
   /**
0
    * Prepare a send buffer.
0
    *

Comments

    No one has commented yet.