com.cudoy.framework.cache.redis.RedisUtils Maven / Gradle / Ivy
The newest version!
package com.cudoy.framework.cache.redis;
public class RedisUtils {
public static int getObjectSize(String value) {
if(value == null || "".equals(value)){
return 0;
}
int index = value.indexOf("serializedlength:") + "serializedlength:".length() ;
if(index < value.length() && index > -1){
String left = value.substring(index);
index= left.indexOf(" ");
if(index > -1) {
return Integer.valueOf(left.substring(0, index));
}
}
return 0;
}
}