Exemplo n.º 1
0
 @Override
 public void put(ByteArrayKey key, byte[] value) {
   try {
     this.client.set(getKey(key), 0, CompressionUtil.compress(value));
   } catch (TimeoutException | InterruptedException | MemcachedException e) {
     throw new MyCachedIoException(e.getMessage(), e);
   }
 }
Exemplo n.º 2
0
 @Override
 public byte[] get(ByteArrayKey key) {
   try {
     final String mmKey = getKey(key);
     final byte[] raw = this.client.get(mmKey);
     return CompressionUtil.uncompress(raw);
   } catch (TimeoutException | InterruptedException | MemcachedException e) {
     throw new MyCachedIoException(e.getMessage(), e);
   }
 }