Exemple #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)));
        }
        /// <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("stream");
            }

            ByteTool.AppendBytes(stream, TypeCode, ByteTool.GetRawBytes(BitConverter.GetBytes(_int), _int < 0));
        }
Exemple #3
0
 /// <summary>
 /// Gets that raw bytes.
 /// </summary>
 /// <returns></returns>
 internal byte[] GetRaw()
 {
     return(ByteTool.GetRawBytes(BitConverter.GetBytes(_count), false));
 }
Exemple #4
0
 /// <summary>
 /// Gets that raw bytes.
 /// </summary>
 /// <returns></returns>
 private byte[] GetRaw()
 {
     return(_raw ?? (_raw = ByteTool.GetRawBytes(BitConverter.GetBytes(_count), false)));
 }