示例#1
0
        public void Write(int value, FieldLength fieldLength)
        {
            var data = BitConverter.GetBytes(value);

            Write(data, fieldLength);
        }
示例#2
0
        public Task WriteAsync(sbyte value, FieldLength fieldLength, CancellationToken cancellationToken)
        {
            var data = new[] { (byte)value };

            return(WriteAsync(data, fieldLength, cancellationToken));
        }
示例#3
0
        public Task WriteAsync(ushort value, FieldLength fieldLength, CancellationToken cancellationToken)
        {
            var data = BitConverter.GetBytes(value);

            return(WriteAsync(data, fieldLength, cancellationToken));
        }
示例#4
0
        public void Write(sbyte value, FieldLength fieldLength)
        {
            var data = new[] { (byte)value };

            Write(data, fieldLength);
        }
示例#5
0
        public Task WriteAsync(char value, FieldLength fieldLength, CancellationToken cancellationToken)
        {
            var data = _encoding.GetBytes(new[] { value });

            return(WriteAsync(data, fieldLength, cancellationToken));
        }
        public void OnMemberDeserialized(ValueNode sender, string name, object value,
                                         BinarySerializationContext context, FieldLength offset, FieldLength localOffset)
        {
            var handle = MemberDeserialized;

            handle?.Invoke(sender, new MemberSerializedEventArgs(name, value, context, offset, localOffset));
        }
        public Task <FieldLength> ReadAsync(byte[] data, FieldLength fieldLength, CancellationToken cancellationToken)
        {
            var length = fieldLength ?? data.Length;

            return(InputStream.ReadAsync(data, length, cancellationToken));
        }
        public FieldLength Read(byte[] data, FieldLength fieldLength)
        {
            var length = fieldLength ?? data.Length;

            return(InputStream.Read(data, length));
        }