EventStreamParseException

Namespace: AWSSDK.Core
We found 10 examples in language CSharp for this search. You will see 48 fragments of code.

        /// <summary>
        /// Builds a message from buffer.
        /// </summary>
        /// <param name="buffer">buffer to read</param>
        /// <param name="offset">offset to start reading</param>
        /// <param name="length">buffer length.</param>
        /// <returns>
        /// parsed instance of EventStreamMessage. Doesn't return null,
        /// does throw if CRCs don't match.
        /// </returns>
        public static EventStreamMessage FromBuffer(byte[] buffer, int offset, int length)
        {
            var currentOffset = offset;

            //get the total length of the message
            var totalLength = BitConverter.ToInt32(buffer, currentOffset);
            //endianness conversion
            totalLength = EndianConversionUtility.NetworkToHostOrder(totalLength);
            currentOffset += SizeOfInt32;

            //get the length of the headers block.
            var headersLength = BitConverter.ToInt32(buffer, currentOffset);
            //endianness conversion
            headersLength = EndianConversionUtility.NetworkToHostOrder(headersLength);
            currentOffset += SizeOfInt32;

            //get the prelude crc
            var preludeCrc = BitConverter.ToInt32(buffer, currentOffset);
            //endianness conversion
            preludeCrc = EndianConversionUtility.NetworkToHostOrder(preludeCrc);

            var message = new EventStreamMessage();
            message.Headers = new Dictionary<string, IEventStreamHeader>(StringComparer.Ordinal);

            using (var nullStream = new NullStream())
            using (var runningChecksum = new CrcCalculatorStream(nullStream))
            {
                //write up to the prelude crc to the checksum stream
                runningChecksum.Write(buffer, offset, currentOffset - offset);
                //compare the current crc to the prelude crc and make sure they match.
                if (preludeCrc != runningChecksum.Crc32)
                {
                    throw new EventStreamChecksumFailureException(string.Format(CultureInfo.InvariantCulture, "Message Prelude Checksum failure. Expected {0} but was {1}", preludeCrc, runningChecksum.Crc32));
                }

                //if the data length passed isn't enough for the total length, that's an error condition.
                if (totalLength != length)
                {
                    throw new EventStreamChecksumFailureException(
                        string.Format(CultureInfo.InvariantCulture, "Message Total Length didn't match the passed in length. Expected {0} but was {1}", length, totalLength));
                }

                //now write the prelude crc to the checksum stream
                runningChecksum.Write(buffer, currentOffset, SizeOfInt32);
                currentOffset += SizeOfInt32;

                //prelude length is total message, minus framing and headers size.
                var payloadLength = totalLength - headersLength - FramingSize;

                //if we have headers, then loop over each one and parse them out.
                if (headersLength > 0)
                {
                    int preOpOffset = currentOffset;
                    while (currentOffset - PreludeLen < headersLength)
                    {
                        EventStreamHeader header = EventStreamHeader.FromBuffer(buffer, currentOffset, ref currentOffset);
                        message.Headers.Add(header.Name, header);
                    }

                    //after parsing the header remember to write that data to the checksum stream
                    runningChecksum.Write(buffer, preOpOffset, currentOffset - preOpOffset);
                }

                // now we're on the payload
                message.Payload = new byte[payloadLength];
                Buffer.BlockCopy(buffer, currentOffset, message.Payload, 0, message.Payload.Length);
                runningChecksum.Write(buffer, currentOffset, message.Payload.Length);
                currentOffset += message.Payload.Length;

                //after reading the payload, get the message crc and make sure it matches.
                var trailingCrc = BitConverter.ToInt32(buffer, currentOffset);
                //endianness conversion.
                trailingCrc = EndianConversionUtility.NetworkToHostOrder(trailingCrc);

                if (trailingCrc != runningChecksum.Crc32)
                {
                    throw new EventStreamChecksumFailureException(
                        string.Format(CultureInfo.InvariantCulture, "Message Checksum failure. Expected {0} but was {1}", trailingCrc, runningChecksum.Crc32));
                }
            }

            return message;
        }

        /// <summary>
        /// Converts a message into a byte buffer (usually for network transmission).
        /// </summary>
        public byte[] ToByteArray()
        {
            int headersWireLength = 0;

            //first we need to figure out how much space the headers will take up.
            if (Headers != null)
            {
                foreach (var header in Headers)
                {
                    headersWireLength += header.Value.GetWireSize();
                }
            }

            var payloadLength = Payload?.Length ?? 0;
            //total message length is the framing size + the payload size + the headers wire size.
            var totalLength = headersWireLength + payloadLength + FramingSize;

            var messageBuffer = new byte[totalLength];

            //now write the total length and the headers length to the message. make sure to handle endianness conversions
            var offset = 0;
            Buffer.BlockCopy(BitConverter.GetBytes(EndianConversionUtility.HostToNetworkOrder(totalLength)), 0,
                messageBuffer, offset, SizeOfInt32);
            offset += SizeOfInt32;
            Buffer.BlockCopy(BitConverter.GetBytes(EndianConversionUtility.HostToNetworkOrder(headersWireLength)), 0,
                messageBuffer, offset, SizeOfInt32);
            offset += SizeOfInt32;

            using (var nullStream = new NullStream())
            using (var runningChecksum = new CrcCalculatorStream(nullStream))
            {
                //write the total length and headers length to the checksum stream.
                runningChecksum.Write(messageBuffer, 0, offset);
                //take the current checksum and write it to the message.
                Buffer.BlockCopy(BitConverter.GetBytes(EndianConversionUtility.HostToNetworkOrder(runningChecksum.Crc32)), 0,
                    messageBuffer, offset, SizeOfInt32);
                //now take the current checksum and write it to the checksum stream.
                runningChecksum.Write(messageBuffer, offset, SizeOfInt32);
                offset += SizeOfInt32;

                //loop over the headers and write them out to the message.
                if (Headers != null)
                {
                    foreach (var header in Headers)
                    {
                        offset = header.Value.WriteToBuffer(messageBuffer, offset);
                    }
                    //make sure to add the header bytes to the checksum stream.
                    runningChecksum.Write(messageBuffer, PreludeLen, offset - PreludeLen);
                }

                //write the payload to the message.
                if (Payload != null)
                {
                    Buffer.BlockCopy(Payload, 0, messageBuffer, offset, Payload.Length);
                    //update the checksum
                    runningChecksum.Write(messageBuffer, offset, Payload.Length);
                    offset += Payload.Length;
                }

                //take the final checksum and add it to the end of the message.
                Buffer.BlockCopy(BitConverter.GetBytes(EndianConversionUtility.HostToNetworkOrder(runningChecksum.Crc32)), 0,
                    messageBuffer, offset, SizeOfInt32);
            }

            return messageBuffer;
        }


        /// <summary>
        /// Builds a message from buffer.
        /// </summary>
        /// <param name="buffer">buffer to read</param>
        /// <param name="offset">offset to start reading</param>
        /// <param name="length">buffer length.</param>
        /// <returns>
        /// parsed instance of EventStreamMessage. Doesn't return null,
        /// does throw if CRCs don't match.
        /// </returns>
        public static EventStreamMessage FromBuffer(byte[] buffer, int offset, int length)
        {
            var currentOffset = offset;

            //get the total length of the message
            var totalLength = BitConverter.ToInt32(buffer, currentOffset);
            //endianness conversion
            totalLength = EndianConversionUtility.NetworkToHostOrder(totalLength);
            currentOffset += SizeOfInt32;

            //get the length of the headers block.
            var headersLength = BitConverter.ToInt32(buffer, currentOffset);
            //endianness conversion
            headersLength = EndianConversionUtility.NetworkToHostOrder(headersLength);
            currentOffset += SizeOfInt32;

            //get the prelude crc
            var preludeCrc = BitConverter.ToInt32(buffer, currentOffset);
            //endianness conversion
            preludeCrc = EndianConversionUtility.NetworkToHostOrder(preludeCrc);

            var message = new EventStreamMessage();
            message.Headers = new Dictionary<string, IEventStreamHeader>(StringComparer.Ordinal);

            using (var nullStream = new NullStream())
            using (var runningChecksum = new CrcCalculatorStream(nullStream))
            {
                //write up to the prelude crc to the checksum stream
                runningChecksum.Write(buffer, offset, currentOffset - offset);
                //compare the current crc to the prelude crc and make sure they match.
                if (preludeCrc != runningChecksum.Crc32)
                {
                    throw new EventStreamChecksumFailureException(string.Format(CultureInfo.InvariantCulture, "Message Prelude Checksum failure. Expected {0} but was {1}", preludeCrc, runningChecksum.Crc32));
                }

                //if the data length passed isn't enough for the total length, that's an error condition.
                if (totalLength != length)
                {
                    throw new EventStreamChecksumFailureException(
                        string.Format(CultureInfo.InvariantCulture, "Message Total Length didn't match the passed in length. Expected {0} but was {1}", length, totalLength));
                }

                //now write the prelude crc to the checksum stream
                runningChecksum.Write(buffer, currentOffset, SizeOfInt32);
                currentOffset += SizeOfInt32;

                //prelude length is total message, minus framing and headers size.
                var payloadLength = totalLength - headersLength - FramingSize;

                //if we have headers, then loop over each one and parse them out.
                if (headersLength > 0)
                {
                    int preOpOffset = currentOffset;
                    while (currentOffset - PreludeLen < headersLength)
                    {
                        EventStreamHeader header = EventStreamHeader.FromBuffer(buffer, currentOffset, ref currentOffset);
                        message.Headers.Add(header.Name, header);
                    }

                    //after parsing the header remember to write that data to the checksum stream
                    runningChecksum.Write(buffer, preOpOffset, currentOffset - preOpOffset);
                }

                // now we're on the payload
                message.Payload = new byte[payloadLength];
                Buffer.BlockCopy(buffer, currentOffset, message.Payload, 0, message.Payload.Length);
                runningChecksum.Write(buffer, currentOffset, message.Payload.Length);
                currentOffset += message.Payload.Length;

                //after reading the payload, get the message crc and make sure it matches.
                var trailingCrc = BitConverter.ToInt32(buffer, currentOffset);
                //endianness conversion.
                trailingCrc = EndianConversionUtility.NetworkToHostOrder(trailingCrc);

                if (trailingCrc != runningChecksum.Crc32)
                {
                    throw new EventStreamChecksumFailureException(
                        string.Format(CultureInfo.InvariantCulture, "Message Checksum failure. Expected {0} but was {1}", trailingCrc, runningChecksum.Crc32));
                }
            }

            return message;
        }

        /// <summary>
        /// Converts a message into a byte buffer (usually for network transmission).
        /// </summary>
        public byte[] ToByteArray()
        {
            int headersWireLength = 0;

            //first we need to figure out how much space the headers will take up.
            if (Headers != null)
            {
                foreach (var header in Headers)
                {
                    headersWireLength += header.Value.GetWireSize();
                }
            }

            var payloadLength = Payload?.Length ?? 0;
            //total message length is the framing size + the payload size + the headers wire size.
            var totalLength = headersWireLength + payloadLength + FramingSize;

            var messageBuffer = new byte[totalLength];

            //now write the total length and the headers length to the message. make sure to handle endianness conversions
            var offset = 0;
            Buffer.BlockCopy(BitConverter.GetBytes(EndianConversionUtility.HostToNetworkOrder(totalLength)), 0,
                messageBuffer, offset, SizeOfInt32);
            offset += SizeOfInt32;
            Buffer.BlockCopy(BitConverter.GetBytes(EndianConversionUtility.HostToNetworkOrder(headersWireLength)), 0,
                messageBuffer, offset, SizeOfInt32);
            offset += SizeOfInt32;

            using (var nullStream = new NullStream())
            using (var runningChecksum = new CrcCalculatorStream(nullStream))
            {
                //write the total length and headers length to the checksum stream.
                runningChecksum.Write(messageBuffer, 0, offset);
                //take the current checksum and write it to the message.
                Buffer.BlockCopy(BitConverter.GetBytes(EndianConversionUtility.HostToNetworkOrder(runningChecksum.Crc32)), 0,
                    messageBuffer, offset, SizeOfInt32);
                //now take the current checksum and write it to the checksum stream.
                runningChecksum.Write(messageBuffer, offset, SizeOfInt32);
                offset += SizeOfInt32;

                //loop over the headers and write them out to the message.
                if (Headers != null)
                {
                    foreach (var header in Headers)
                    {
                        offset = header.Value.WriteToBuffer(messageBuffer, offset);
                    }
                    //make sure to add the header bytes to the checksum stream.
                    runningChecksum.Write(messageBuffer, PreludeLen, offset - PreludeLen);
                }

                //write the payload to the message.
                if (Payload != null)
                {
                    Buffer.BlockCopy(Payload, 0, messageBuffer, offset, Payload.Length);
                    //update the checksum
                    runningChecksum.Write(messageBuffer, offset, Payload.Length);
                    offset += Payload.Length;
                }

                //take the final checksum and add it to the end of the message.
                Buffer.BlockCopy(BitConverter.GetBytes(EndianConversionUtility.HostToNetworkOrder(runningChecksum.Crc32)), 0,
                    messageBuffer, offset, SizeOfInt32);
            }

            return messageBuffer;
        }


        /// <summary>
        /// Builds a message from buffer.
        /// </summary>
        /// <param name="buffer">buffer to read</param>
        /// <param name="offset">offset to start reading</param>
        /// <param name="length">buffer length.</param>
        /// <returns>
        /// parsed instance of EventStreamMessage. Doesn't return null,
        /// does throw if CRCs don't match.
        /// </returns>
        public static EventStreamMessage FromBuffer(byte[] buffer, int offset, int length)
        {
            var currentOffset = offset;

            //get the total length of the message
            var totalLength = BitConverter.ToInt32(buffer, currentOffset);
            //endianness conversion
            totalLength = EndianConversionUtility.NetworkToHostOrder(totalLength);
            currentOffset += SizeOfInt32;

            //get the length of the headers block.
            var headersLength = BitConverter.ToInt32(buffer, currentOffset);
            //endianness conversion
            headersLength = EndianConversionUtility.NetworkToHostOrder(headersLength);
            currentOffset += SizeOfInt32;

            //get the prelude crc
            var preludeCrc = BitConverter.ToInt32(buffer, currentOffset);
            //endianness conversion
            preludeCrc = EndianConversionUtility.NetworkToHostOrder(preludeCrc);

            var message = new EventStreamMessage();
            message.Headers = new Dictionary<string, IEventStreamHeader>(StringComparer.Ordinal);

            using (var nullStream = new NullStream())
            using (var runningChecksum = new CrcCalculatorStream(nullStream))
            {
                //write up to the prelude crc to the checksum stream
                runningChecksum.Write(buffer, offset, currentOffset - offset);
                //compare the current crc to the prelude crc and make sure they match.
                if (preludeCrc != runningChecksum.Crc32)
                {
                    throw new EventStreamChecksumFailureException(string.Format(CultureInfo.InvariantCulture, "Message Prelude Checksum failure. Expected {0} but was {1}", preludeCrc, runningChecksum.Crc32));
                }

                //if the data length passed isn't enough for the total length, that's an error condition.
                if (totalLength != length)
                {
                    throw new EventStreamChecksumFailureException(
                        string.Format(CultureInfo.InvariantCulture, "Message Total Length didn't match the passed in length. Expected {0} but was {1}", length, totalLength));
                }

                //now write the prelude crc to the checksum stream
                runningChecksum.Write(buffer, currentOffset, SizeOfInt32);
                currentOffset += SizeOfInt32;

                //prelude length is total message, minus framing and headers size.
                var payloadLength = totalLength - headersLength - FramingSize;

                //if we have headers, then loop over each one and parse them out.
                if (headersLength > 0)
                {
                    int preOpOffset = currentOffset;
                    while (currentOffset - PreludeLen < headersLength)
                    {
                        EventStreamHeader header = EventStreamHeader.FromBuffer(buffer, currentOffset, ref currentOffset);
                        message.Headers.Add(header.Name, header);
                    }

                    //after parsing the header remember to write that data to the checksum stream
                    runningChecksum.Write(buffer, preOpOffset, currentOffset - preOpOffset);
                }

                // now we're on the payload
                message.Payload = new byte[payloadLength];
                Buffer.BlockCopy(buffer, currentOffset, message.Payload, 0, message.Payload.Length);
                runningChecksum.Write(buffer, currentOffset, message.Payload.Length);
                currentOffset += message.Payload.Length;

                //after reading the payload, get the message crc and make sure it matches.
                var trailingCrc = BitConverter.ToInt32(buffer, currentOffset);
                //endianness conversion.
                trailingCrc = EndianConversionUtility.NetworkToHostOrder(trailingCrc);

                if (trailingCrc != runningChecksum.Crc32)
                {
                    throw new EventStreamChecksumFailureException(
                        string.Format(CultureInfo.InvariantCulture, "Message Checksum failure. Expected {0} but was {1}", trailingCrc, runningChecksum.Crc32));
                }
            }

            return message;
        }

        /// <summary>
        /// Converts a message into a byte buffer (usually for network transmission).
        /// </summary>
        public byte[] ToByteArray()
        {
            int headersWireLength = 0;

            //first we need to figure out how much space the headers will take up.
            if (Headers != null)
            {
                foreach (var header in Headers)
                {
                    headersWireLength += header.Value.GetWireSize();
                }
            }

            var payloadLength = Payload?.Length ?? 0;
            //total message length is the framing size + the payload size + the headers wire size.
            var totalLength = headersWireLength + payloadLength + FramingSize;

            var messageBuffer = new byte[totalLength];

            //now write the total length and the headers length to the message. make sure to handle endianness conversions
            var offset = 0;
            Buffer.BlockCopy(BitConverter.GetBytes(EndianConversionUtility.HostToNetworkOrder(totalLength)), 0,
                messageBuffer, offset, SizeOfInt32);
            offset += SizeOfInt32;
            Buffer.BlockCopy(BitConverter.GetBytes(EndianConversionUtility.HostToNetworkOrder(headersWireLength)), 0,
                messageBuffer, offset, SizeOfInt32);
            offset += SizeOfInt32;

            using (var nullStream = new NullStream())
            using (var runningChecksum = new CrcCalculatorStream(nullStream))
            {
                //write the total length and headers length to the checksum stream.
                runningChecksum.Write(messageBuffer, 0, offset);
                //take the current checksum and write it to the message.
                Buffer.BlockCopy(BitConverter.GetBytes(EndianConversionUtility.HostToNetworkOrder(runningChecksum.Crc32)), 0,
                    messageBuffer, offset, SizeOfInt32);
                //now take the current checksum and write it to the checksum stream.
                runningChecksum.Write(messageBuffer, offset, SizeOfInt32);
                offset += SizeOfInt32;

                //loop over the headers and write them out to the message.
                if (Headers != null)
                {
                    foreach (var header in Headers)
                    {
                        offset = header.Value.WriteToBuffer(messageBuffer, offset);
                    }
                    //make sure to add the header bytes to the checksum stream.
                    runningChecksum.Write(messageBuffer, PreludeLen, offset - PreludeLen);
                }

                //write the payload to the message.
                if (Payload != null)
                {
                    Buffer.BlockCopy(Payload, 0, messageBuffer, offset, Payload.Length);
                    //update the checksum
                    runningChecksum.Write(messageBuffer, offset, Payload.Length);
                    offset += Payload.Length;
                }

                //take the final checksum and add it to the end of the message.
                Buffer.BlockCopy(BitConverter.GetBytes(EndianConversionUtility.HostToNetworkOrder(runningChecksum.Crc32)), 0,
                    messageBuffer, offset, SizeOfInt32);
            }

            return messageBuffer;
        }


        /// <summary>
        /// Computes the amount of memory neccesary to serialize this Header.
        /// </summary>
        [SuppressMessage("Microsoft.Design", "CA1024", Justification = "Method can throw an exception.")]
        int GetWireSize();

        /// <summary>
        /// Returns the current value as a bool
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1720", Justification = "Current name is most descriptive.")]
        bool AsBool();

        /// <summary>
        /// Returns the current value as a byte
        /// </summary>
        Byte AsByte();

        /// <summary>
        /// Sets the current value
        /// </summary>
        void SetByte(Byte value);

        /// <summary>
        /// Gets the current value as a 16 bit integer. (Host Order).
        /// </summary>
        /// <returns></returns>
        Int16 AsInt16();

        /// <summary>
        /// Sets the current value. (Host Order)
        /// </summary>
        void SetInt16(Int16 value);


        /// <summary>
        /// Computes the amount of memory neccesary to serialize this Header.
        /// </summary>
        [SuppressMessage("Microsoft.Design", "CA1024", Justification = "Method can throw an exception.")]
        int GetWireSize();

        /// <summary>
        /// Returns the current value as a bool
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1720", Justification = "Current name is most descriptive.")]
        bool AsBool();

        /// <summary>
        /// Returns the current value as a byte
        /// </summary>
        Byte AsByte();

        /// <summary>
        /// Sets the current value
        /// </summary>
        void SetByte(Byte value);

        /// <summary>
        /// Gets the current value as a 16 bit integer. (Host Order).
        /// </summary>
        /// <returns></returns>
        Int16 AsInt16();

        /// <summary>
        /// Sets the current value. (Host Order)
        /// </summary>
        void SetInt16(Int16 value);


        /// <summary>
        /// Computes the amount of memory neccesary to serialize this Header.
        /// </summary>
        [SuppressMessage("Microsoft.Design", "CA1024", Justification = "Method can throw an exception.")]
        int GetWireSize();

        /// <summary>
        /// Returns the current value as a bool
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1720", Justification = "Current name is most descriptive.")]
        bool AsBool();

        /// <summary>
        /// Returns the current value as a byte
        /// </summary>
        Byte AsByte();

        /// <summary>
        /// Sets the current value
        /// </summary>
        void SetByte(Byte value);

        /// <summary>
        /// Gets the current value as a 16 bit integer. (Host Order).
        /// </summary>
        /// <returns></returns>
        Int16 AsInt16();

        /// <summary>
        /// Sets the current value. (Host Order)
        /// </summary>
        void SetInt16(Int16 value);


        /// <summary>
        /// Computes the amount of memory neccesary to serialize this Header.
        /// </summary>
        [SuppressMessage("Microsoft.Design", "CA1024", Justification = "Method can throw an exception.")]
        int GetWireSize();

        /// <summary>
        /// Returns the current value as a bool
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1720", Justification = "Current name is most descriptive.")]
        bool AsBool();

        /// <summary>
        /// Returns the current value as a byte
        /// </summary>
        Byte AsByte();

        /// <summary>
        /// Sets the current value
        /// </summary>
        void SetByte(Byte value);

        /// <summary>
        /// Gets the current value as a 16 bit integer. (Host Order).
        /// </summary>
        /// <returns></returns>
        Int16 AsInt16();

        /// <summary>
        /// Sets the current value. (Host Order)
        /// </summary>
        void SetInt16(Int16 value);


        /// <summary>
        /// Computes the amount of memory neccesary to serialize this Header.
        /// </summary>
        [SuppressMessage("Microsoft.Design", "CA1024", Justification = "Method can throw an exception.")]
        int GetWireSize();

        /// <summary>
        /// Returns the current value as a bool
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1720", Justification = "Current name is most descriptive.")]
        bool AsBool();

        /// <summary>
        /// Returns the current value as a byte
        /// </summary>
        Byte AsByte();

        /// <summary>
        /// Sets the current value
        /// </summary>
        void SetByte(Byte value);

        /// <summary>
        /// Gets the current value as a 16 bit integer. (Host Order).
        /// </summary>
        /// <returns></returns>
        Int16 AsInt16();

        /// <summary>
        /// Sets the current value. (Host Order)
        /// </summary>
        void SetInt16(Int16 value);


        /// <summary>
        /// Computes the amount of memory neccesary to serialize this Header.
        /// </summary>
        [SuppressMessage("Microsoft.Design", "CA1024", Justification = "Method can throw an exception.")]
        int GetWireSize();

        /// <summary>
        /// Returns the current value as a bool
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1720", Justification = "Current name is most descriptive.")]
        bool AsBool();

        /// <summary>
        /// Returns the current value as a byte
        /// </summary>
        Byte AsByte();

        /// <summary>
        /// Sets the current value
        /// </summary>
        void SetByte(Byte value);

        /// <summary>
        /// Gets the current value as a 16 bit integer. (Host Order).
        /// </summary>
        /// <returns></returns>
        Int16 AsInt16();

        /// <summary>
        /// Sets the current value. (Host Order)
        /// </summary>
        void SetInt16(Int16 value);


        /// <summary>
        /// Computes the amount of memory neccesary to serialize this Header.
        /// </summary>
        [SuppressMessage("Microsoft.Design", "CA1024", Justification = "Method can throw an exception.")]
        int GetWireSize();

        /// <summary>
        /// Returns the current value as a bool
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1720", Justification = "Current name is most descriptive.")]
        bool AsBool();

        /// <summary>
        /// Returns the current value as a byte
        /// </summary>
        Byte AsByte();

        /// <summary>
        /// Sets the current value
        /// </summary>
        void SetByte(Byte value);

        /// <summary>
        /// Gets the current value as a 16 bit integer. (Host Order).
        /// </summary>
        /// <returns></returns>
        Int16 AsInt16();

        /// <summary>
        /// Sets the current value. (Host Order)
        /// </summary>
        void SetInt16(Int16 value);

Amazon.Runtime.EventStreams.EventStreamParseException : ISerializable

Constructors :

public EventStreamParseException(String message = )

Methods :

public MethodBase get_TargetSite()
public String get_Message()
public IDictionary get_Data()
public Exception GetBaseException()
public Exception get_InnerException()
public String get_HelpLink()
public Void set_HelpLink(String value = )
public String get_Source()
public Void set_Source(String value = )
public Void GetObjectData(SerializationInfo info = , StreamingContext context = )
public String ToString()
public Int32 get_HResult()
public Void set_HResult(Int32 value = )
public Type GetType()
public String get_StackTrace()
public Type GetType()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()