OpenStory.Common.IO.PacketBuilder.WriteBytes C# (CSharp) Method

WriteBytes() public method

public WriteBytes ( byte bytes ) : void
bytes byte
return void
        public void WriteBytes(byte[] bytes)
        {
            this.ThrowIfDisposed();

            Guard.NotNull(() => bytes, bytes);

            this.stream.Write(bytes, 0, bytes.Length);
        }

Usage Example

Exemplo n.º 1
0
        private static byte[] ConstructHandshakePacketContent(HandshakeInfo handshakeInfo)
        {
            using (var builder = new PacketBuilder())
            {
                builder.WriteInt16(handshakeInfo.Version);
                builder.WriteLengthString(handshakeInfo.Subversion);
                builder.WriteBytes(handshakeInfo.ServerIv);
                builder.WriteBytes(handshakeInfo.ClientIv);

                // Locale ID (used for localizations and test servers)
                builder.WriteByte(handshakeInfo.LocaleId);

                return builder.ToByteArray();
            }
        }
All Usage Examples Of OpenStory.Common.IO.PacketBuilder::WriteBytes