/// <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> /// Gets that raw bytes. /// </summary> /// <returns></returns> internal byte[] GetRaw() { return(_raw ?? (_raw = ByteTool.GetRawBytes(BitConverter.GetBytes(_count), false))); }