/// <summary> /// Append a byte array to a byte stream preceded by a /// two-byte (little endian) count of the array size /// </summary> /// <param name="s"></param> /// <param name="bytes"></param> static void AppendCountedBytes( this Stream s, byte[] bytes) { s.AppendBytes(new byte[] { (byte)bytes.Length, 0x00 }); s.AppendBytes(bytes); }
/// <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"); stream.AppendBytes (TypeCode, _length, _ip); }
/// <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(nameof(stream)); } stream.AppendBytes(TypeCode, _length, Array.Empty <byte>()); }
/// <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"); } stream.AppendBytes(TypeCode, _length, _ip.GetAddressBytes()); }
/// <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"); } stream.AppendBytes(TypeCode, GetRaw()); }
/// <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, _count.GetLengthBytes(), _count.GetRaw()); }
/// <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"); } stream.AppendBytes(TypeCode, 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"); } if (_raw == null) { _raw = ByteTool.ParseItems(_list); } stream.AppendBytes(TypeCode, _raw); }
/// <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"); } if (_raw == null) { _raw = ByteTool.ParseItems(Enterprise, AgentAddress, _generic, _specific, TimeStamp, _varbindSection); } stream.AppendBytes(TypeCode, _raw); }
/// <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)); } if (_buffer == null) { _buffer = ByteTool.ParseItems(_list); } stream.AppendBytes(TypeCode, _length, _buffer); }
/// <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"); } if (_raw == null) { _raw = ByteTool.ParseItems(RequestId, ErrorStatus, ErrorIndex, _varbindSection); } stream.AppendBytes(TypeCode, _length, _raw); }
/// <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)); } if (_raw == null) { _raw = ByteTool.ParseItems(RequestId, Integer32.Zero, Integer32.Zero, _varbindSection); } stream.AppendBytes(TypeCode, _length, _raw); }
/// <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"); } // TODO: improve here. var temp = new List <byte>(); var first = (byte)((40 * _oid[0]) + _oid[1]); temp.Add(first); for (var i = 2; i < _oid.Length; i++) { temp.AddRange(ConvertToBytes(_oid[i])); } stream.AppendBytes(TypeCode, temp.ToArray()); }
/// <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"); } if (_raw == null) { _raw = ByteTool.ParseItems(Enterprise, AgentAddress, _generic, _specific, TimeStamp, _varbindSection); } stream.AppendBytes(TypeCode, _length, _raw); }
/// <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"); } if (_buffer == null) { _buffer = ByteTool.ParseItems(_list); } stream.AppendBytes(TypeCode, _length, _buffer); }
/// <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"); } if (_raw == null) { _raw = ByteTool.ParseItems(RequestId, ErrorStatus, ErrorIndex, _varbindSection); } stream.AppendBytes(TypeCode, _length, _raw); }