Пример #1
0
        /// <summary>
        /// Appends the bytes to <see cref="Stream"/>.
        /// </summary>
        /// <param name="stream">The stream.</param>
        public void AppendBytesTo(Stream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            stream.AppendBytes(TypeCode, _length, _raw ?? (_raw = ByteTool.GetRawBytes(BitConverter.GetBytes(_int), _int < 0)));
        }
Пример #2
0
 /// <summary>
 /// Gets that raw bytes.
 /// </summary>
 /// <returns></returns>
 private byte[] GetRaw()
 {
     return(_raw ?? (_raw = ByteTool.GetRawBytes(BitConverter.GetBytes(_count), false)));
 }