コード例 #1
0
        /// <summary>
        /// Clone the <see cref="YEncoder"/> with its current state.
        /// </summary>
        /// <remarks>
        /// Creates a new <see cref="YEncoder"/> with exactly the same state as the current encoder.
        /// </remarks>
        /// <returns>A new <see cref="YEncoder"/> with identical state.</returns>
        public IMimeEncoder Clone()
        {
            var encoder = new YEncoder(lineLength);

            encoder.crc    = crc.Clone();
            encoder.octets = octets;

            return(encoder);
        }
コード例 #2
0
        /// <summary>
        /// Clone the <see cref="YDecoder"/> with its current state.
        /// </summary>
        /// <remarks>
        /// Creates a new <see cref="YDecoder"/> with exactly the same state as the current decoder.
        /// </remarks>
        /// <returns>A new <see cref="YDecoder"/> with identical state.</returns>
        public IMimeDecoder Clone()
        {
            var decoder = new YDecoder(initial == YDecoderState.Payload);

            decoder.crc   = crc.Clone();
            decoder.state = state;
            decoder.octet = octet;
            decoder.eoln  = eoln;

            return(decoder);
        }