Ejemplo n.º 1
0
 public void Pack(MemoryStream stream)
 {
     BigEndianUtilities.WriteUShort(stream, BuildNumber);
     stream.WriteByte(Minor);
     stream.WriteByte(Major);
     BigEndianUtilities.WriteUShort(stream, SubBuildNumber);
 }
Ejemplo n.º 2
0
        public void WriteUShortToMemoryStream()
        {
            var stream = new MemoryStream();

            BigEndianUtilities.WriteUShort(stream, 0x0123);

            CollectionAssert.AreEqual(new byte[] { 0x01, 0x23 }, stream.ToArray());
        }
Ejemplo n.º 3
0
 public void Pack(MemoryStream stream)
 {
     stream.WriteByte((byte)Type);
     stream.WriteByte((byte)Status);
     BigEndianUtilities.WriteUShort(stream, Length);
     BigEndianUtilities.WriteUShort(stream, SPID);
     stream.WriteByte(Packet);
     stream.WriteByte(Window);
 }
 /// <summary>
 /// Used to pack IPackageable to a stream.
 /// </summary>
 /// <param name="stream">MemoryStream in which IPackageable is packet into.</param>
 public void Pack(MemoryStream stream)
 {
     stream.WriteByte((byte)this.Type);
     if (this.Type != TDSPreLoginOptionTokenType.Terminator)
     {
         BigEndianUtilities.WriteUShort(stream, this.Offset);
         BigEndianUtilities.WriteUShort(stream, this.Length);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Used to pack IPackageable to a stream.
 /// </summary>
 /// <param name="stream">MemoryStream in which IPackageable is packet into.</param>
 public void Pack(MemoryStream stream)
 {
     stream.WriteByte((byte)this.Type);
     stream.WriteByte((byte)this.Status);
     BigEndianUtilities.WriteUShort(stream, this.Length);
     BigEndianUtilities.WriteUShort(stream, this.SPID);
     stream.WriteByte(this.Packet);
     stream.WriteByte(this.Window);
 }