Ejemplo n.º 1
0
        /// <inheritdoc />
        public override Task SerializeAsync(bool obj, SmppWriter writer, SmppSerializationSettings serializationSettings, CancellationToken cancellationToken)
        {
            var value = obj ? 1 : 0;

            return(writer.WriteAsync((byte)value));
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public override async Task SerializeAsync(SmppTime obj, SmppWriter writer, CancellationToken cancellationToken)
        {
            var s = obj.ToSmppString();

            await writer.WriteAsync(s);
        }
Ejemplo n.º 3
0
 /// <inheritdoc />
 public override Task SerializeAsync(byte obj, SmppWriter writer, CancellationToken cancellationToken)
 {
     cancellationToken.ThrowIfCancellationRequested();
     return(writer.WriteAsync(obj));
 }
Ejemplo n.º 4
0
 /// <inheritdoc />
 public override Task SerializeAsync(string obj, SmppWriter writer, CancellationToken cancellationToken)
 {
     return(writer.WriteAsync(obj));
 }
        /// <inheritdoc />
        public override async Task SerializeAsync(string obj, SmppWriter writer, CancellationToken cancellationToken)
        {
            await writer.WriteAsync(obj);

            await writer.WriteAsync((byte)0);
        }