protected override void OnWrite(DateTime[] value, TProtocolWriter writer) { if (value == null) { writer.WriteI64Array(null); } else { long[] result = new long[value.Length]; for (var i = 0; i < value.Length; i++) { result[i] = DateTimeThriftCodec.ToLongValue(value[i]); } writer.WriteI64Array(result); } }
protected override DateTime[] OnRead(TProtocolReader reader) { var longArray = reader.ReadI64Array(); if (longArray == null) { return(null); } else { DateTime[] result = new DateTime[longArray.Length]; for (var i = 0; i < longArray.Length; i++) { result[i] = DateTimeThriftCodec.FromLongValue(longArray[i]); } return(result); } }