code: public static int size(Object obj) {
  		if (obj == null) {
  			return 0;
  		}
  		ByteArrayOutputStream buf = new ByteArrayOutputStream(4096);
  		try {
  			ObjectOutputStream out = new ObjectOutputStream(buf);
  			out.writeObject(obj);
  			out.flush();
  			buf.close();
  		} catch (IOException e) {
  			return 0;
  		}
  
  		return buf.size();
  	}
docs: 计算对象长度
  
  @param obj 需要计算长度的对象
  
  @return 对象长度 (byte)