public override int Estimate(TBase[] objs) { int bytes = 0; foreach (var obj in objs) { if (!EqualityComparer <TBase> .Default.Equals(obj, default(TBase))) { bytes += BaseEncoder.Estimate(obj); } } return(bytes + BoolArrayEncoder.getBytesLength(objs.Length) + 4); }
public override int Estimate(TBase[] objs) { if (BaseEncoder.FixedSize) { return(objs.Length * BaseEncoder.ByteSize + 4); } int result = 4; foreach (var obj in objs) { result += BaseEncoder.Estimate(obj); } return(result); }