Esempio n. 1
0
        /// <summary>
        /// Deserialize a 64 bits value.
        /// </summary>
        /// <param name="buffer">The buffer containing the serialized data.</param>
        /// <param name="start">The start index in the buffer of the serialized value.</param>
        /// <param name="value">The deserialized value.</param>
        /// <returns>The number of deserialized bytes.</returns>
        protected uint FromBytes(Buffer buffer, uint start, out Converter64 value)
        {
            Converter32 i1, i2;

            uint read = FromBytes(buffer, start, out i1);

            read += FromBytes(buffer, start + read, out i2);

            value = new Converter64(i1, i2);

            return(read);
        }
Esempio n. 2
0
        /// <summary>
        /// Serialize a 64 bits value.
        /// </summary>
        /// <param name="buffer">The buffer where to serialize the data.</param>
        /// <param name="start">The start index in the buffer where to serialize the data.</param>
        /// <param name="value">The value to serialize.</param>
        /// <returns>The number of serialized bytes.</returns>
        public uint ToBytes(ref Buffer buffer, uint start, Converter64 value)
        {
            CheckSerializationParameters(buffer, start);

            // Resize buffer if necessary
            ResizeBuffer(ref buffer, start + longSize);

            uint written = ToBytes(ref buffer, start, value.Int1);

            written += ToBytes(ref buffer, start + written, value.Int2);

            return(written);
        }