public override void Serialize(long[] record, IDataOutputView target)
        {
            if (record == null)
            {
                throw new IllegalArgumentException("The record must not be null.");
            }

            var len = record.Length;

            target.WriteLong(len);
            for (var i = 0; i < len; i++)
            {
                target.WriteLong(record[i]);
            }
        }
        public override void Serialize(StreamElement value, IDataOutputView target)
        {
            if (value.IsRecord)
            {
                var record = value.AsRecord <T>();

                if (record.HasTimestamp)
                {
                    target.Write(TagRecWithTimestamp);
                    target.WriteLong(record.Timestamp);
                }
                else
                {
                    target.Write(TagRecWithoutTimestamp);
                }

                ContainedTypeSerializer.Serialize(record.Value, target);
            }
            else if (value.IsWatermark)
            {
                target.Write(TagWatermark);
                target.WriteLong(value.AsWatermark().Timestamp);
            }
            else if (value.IsStreamStatus)
            {
                target.Write(TagStreamStatus);
                target.WriteInt(value.AsStreamStatus().Status);
            }
            else if (value.IsLatencyMarker)
            {
                target.Write(TagLatencyMarker);
                target.WriteLong(value.AsLatencyMarker().MarkedTime);
                target.WriteLong(value.AsLatencyMarker().OperatorId.LowerPart);
                target.WriteLong(value.AsLatencyMarker().OperatorId.UpperPart);
                target.WriteInt(value.AsLatencyMarker().SubTaskIndex);
            }
            else
            {
                throw new RuntimeException();
            }
        }
 public override void Serialize(DateTime record, IDataOutputView target) => target.WriteLong(record.Ticks);
 public override void Copy(IDataInputView source, IDataOutputView target) => target.WriteLong(source.ReadLong());
 public override void Serialize(long record, IDataOutputView target) => target.WriteLong(record);