1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
7 namespace Microsoft.SqlServer.TDS.SessionState
10 /// Generic session state option
12 public class TDSSessionStateGenericOption : TDSSessionStateOption
15 /// State option value
17 public byte[] Value { get; set; }
20 /// Initialization constructor
22 public TDSSessionStateGenericOption(byte stateID) :
28 /// Initialization constructor
30 public TDSSessionStateGenericOption(byte stateID, byte[] value) :
37 /// Deflate state into the stream
39 public override void Deflate(Stream destination)
42 destination.WriteByte(StateID);
45 DeflateValue(destination, Value);
49 /// Inflate from stream
51 public override bool Inflate(Stream source)
53 // Reset inflation size
56 // NOTE: state ID is skipped because it is read by the construction factory
59 Value = InflateValue(source);
61 // Inflation is complete