/// <summary>
        /// Initializes a new instance of the StreamObjectHeaderStart16bit class with specified type and length.
        /// </summary>
        /// <param name="type">Specify the type of the StreamObjectHeaderStart16bit.</param>
        /// <param name="length">Specify the length of the StreamObjectHeaderStart16bit.</param>
        public StreamObjectHeaderStart16bit(StreamObjectTypeHeaderStart type, int length)
        {
            if (this.Length > 127)
            {
                throw new ArgumentOutOfRangeException("Length", "16-bit Stream Object Header Start, Length (7-bits): A 7-bit unsigned integer that specifies the length in bytes for additional data (if any). If the length is more than 127 bytes, a 32-bit stream object header start MUST be used.");
            }

            this.HeaderType = 0x0;
            this.Type       = type;
            this.Compound   = StreamObject.CompoundTypes.Contains(this.Type) ? 1 : 0;
            this.Length     = length;
        }
        /// <summary>
        /// Initializes a new instance of the StreamObjectHeaderStart32bit class with specified type and length.
        /// </summary>
        /// <param name="type">Specify the type of the StreamObjectHeaderStart32bit.</param>
        /// <param name="length">Specify the length of the StreamObjectHeaderStart32bit.</param>
        public StreamObjectHeaderStart32bit(StreamObjectTypeHeaderStart type, int length)
        {
            this.HeaderType = StreamObjectHeaderStart.StreamObjectHeaderStart32bit;
            this.Type       = type;
            this.Compound   = StreamObject.CompoundTypes.Contains(this.Type) ? 1 : 0;

            if (length >= 32767)
            {
                this.Length      = 32767;
                this.LargeLength = new Compact64bitInt((ulong)length);
            }
            else
            {
                this.Length      = length;
                this.LargeLength = null;
            }
        }
 /// <summary>
 /// Initializes a new instance of the StreamObjectHeaderStart32bit class with specified type.
 /// </summary>
 /// <param name="streamObjectTypeHeaderStart">Specify the type of the StreamObjectHeaderStart32bit.</param>
 public StreamObjectHeaderStart32bit(StreamObjectTypeHeaderStart streamObjectTypeHeaderStart)
 {
     this.Type = streamObjectTypeHeaderStart;
 }
 /// <summary>
 /// Initializes a new instance of the StreamObjectHeaderStart16bit class with specified type.
 /// </summary>
 /// <param name="type">Specify the type of the StreamObjectHeaderStart16bit.</param>
 public StreamObjectHeaderStart16bit(StreamObjectTypeHeaderStart type)
     : this(type, 0)
 {
 }
 /// <summary>
 /// Initializes a new instance of the StreamObjectHeaderStart32bit class with specified type.
 /// </summary>
 /// <param name="streamObjectTypeHeaderStart">Specify the type of the StreamObjectHeaderStart32bit.</param>
 public StreamObjectHeaderStart32bit(StreamObjectTypeHeaderStart streamObjectTypeHeaderStart)
 {
     this.Type = streamObjectTypeHeaderStart;
 }
 /// <summary>
 /// Initializes a new instance of the StreamObjectHeaderStart class with specified header type.
 /// </summary>
 /// <param name="streamObjectTypeHeaderStart">Specify the value of the StreamObjectHeaderStart Type.</param>
 protected StreamObjectHeaderStart(StreamObjectTypeHeaderStart streamObjectTypeHeaderStart)
 {
     this.Type = streamObjectTypeHeaderStart;
 }
 /// <summary>
 /// Initializes a new instance of the StreamObjectHeaderStart16bit class with specified type.
 /// </summary>
 /// <param name="type">Specify the type of the StreamObjectHeaderStart16bit.</param>
 public StreamObjectHeaderStart16bit(StreamObjectTypeHeaderStart type)
     : this(type, 0)
 {
 }
        /// <summary>
        /// Parse the bit32StreamObjectHeaderStart structure.
        /// </summary>
        /// <param name="s">An stream containing bit32StreamObjectHeaderStart structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            int index = 0;
            int temp = ReadINT32();
            this.A = (byte)GetBits(temp, index, 2);
            index = index + 2;
            this.B = (byte)GetBits(temp, index, 1);
            index = index + 1;
            this.Type = (StreamObjectTypeHeaderStart)GetBits(temp, index, 14);
            index = index + 14;
            this.Length = (byte)GetBits(temp, index, 15);

            if (this.Length == 32767)
            {
                this.LargeLength = new CompactUnsigned64bitInteger();
                this.LargeLength = this.LargeLength.TryParse(s);
            }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the ErrorData class.
 /// </summary>
 /// <param name="headerType">The instance of StreamObjectTypeHeaderStart.</param>
 protected ErrorData(StreamObjectTypeHeaderStart headerType)
     : base(headerType)
 {
 }
        /// <summary>
        /// Initializes a new instance of the StreamObjectHeaderStart16bit class with specified type and length.
        /// </summary>
        /// <param name="type">Specify the type of the StreamObjectHeaderStart16bit.</param>
        /// <param name="length">Specify the length of the StreamObjectHeaderStart16bit.</param>
        public StreamObjectHeaderStart16bit(StreamObjectTypeHeaderStart type, int length)
        {
            if (this.Length > 127)
            {
                throw new ArgumentOutOfRangeException("Length", "16-bit Stream Object Header Start, Length (7-bits): A 7-bit unsigned integer that specifies the length in bytes for additional data (if any). If the length is more than 127 bytes, a 32-bit stream object header start MUST be used.");
            }

            this.HeaderType = 0x0;
            this.Type = type;
            this.Compound = StreamObject.CompoundTypes.Contains(this.Type) ? 1 : 0;
            this.Length = length;
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the SpecializedKnowledgeData class.
 /// </summary>
 /// <param name="headerType">The instance of StreamObjectTypeHeaderStart.</param>
 protected SpecializedKnowledgeData(StreamObjectTypeHeaderStart headerType)
     : base(headerType)
 {
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the StreamObject class.
 /// </summary>
 /// <param name="streamObjectType">The instance of StreamObjectTypeHeaderStart.</param>
 protected StreamObject(StreamObjectTypeHeaderStart streamObjectType)
 {
     this.StreamObjectType = streamObjectType;
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the NodeObject class.
 /// </summary>
 /// <param name="headerType">Specify the node object header type.</param>
 protected NodeObject(StreamObjectTypeHeaderStart headerType)
     : base(headerType)
 {
 }
 /// <summary>
 /// Initializes a new instance of the StreamObjectHeaderStart class with specified header type.
 /// </summary>
 /// <param name="streamObjectTypeHeaderStart">Specify the value of the StreamObjectHeaderStart Type.</param>
 protected StreamObjectHeaderStart(StreamObjectTypeHeaderStart streamObjectTypeHeaderStart)
 {
     this.Type = streamObjectTypeHeaderStart;
 }
        /// <summary>
        /// Initializes a new instance of the StreamObjectHeaderStart32bit class with specified type and length.
        /// </summary>
        /// <param name="type">Specify the type of the StreamObjectHeaderStart32bit.</param>
        /// <param name="length">Specify the length of the StreamObjectHeaderStart32bit.</param>
        public StreamObjectHeaderStart32bit(StreamObjectTypeHeaderStart type, int length)
        {
            this.HeaderType = StreamObjectHeaderStart.StreamObjectHeaderStart32bit;
            this.Type = type;
            this.Compound = StreamObject.CompoundTypes.Contains(this.Type) ? 1 : 0;

            if (length >= 32767)
            {
                this.Length = 32767;
                this.LargeLength = new Compact64bitInt((ulong)length);
            }
            else
            {
                this.Length = length;
                this.LargeLength = null;
            }
        }
Ejemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the NodeObject class.
 /// </summary>
 /// <param name="headerType">Specify the node object header type.</param>
 protected NodeObject(StreamObjectTypeHeaderStart headerType)
     : base(headerType)
 {
 }
 /// <summary>
 /// Parse the bit16StreamObjectHeaderStart structure.
 /// </summary>
 /// <param name="s">An stream containing bit16StreamObjectHeaderStart structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     int index = 0;
     short temp = ReadINT16();
     this.A = (byte)GetBits(temp, index, 2);
     index = index + 2;
     this.B = (byte)GetBits(temp, index, 1);
     index = index + 1;
     this.Type = (StreamObjectTypeHeaderStart)GetBits(temp, index, 6);
     index = index + 6;
     this.Length = (byte)GetBits(temp, index, 7);
 }