Server.Network.PacketWriter.WriteAsciiNull C# (CSharp) Méthode

WriteAsciiNull() public méthode

Writes a dynamic-length ASCII-encoded string value to the underlying stream, followed by a 1-byte null character.
public WriteAsciiNull ( string value ) : void
value string
Résultat void
		public void WriteAsciiNull( string value )
		{
			if ( value == null )
			{
				Console.WriteLine( "Network: Attempted to WriteAsciiNull() with null value" );
				value = String.Empty;
			}

			int length = value.Length;

			m_Stream.SetLength( m_Stream.Length + length + 1 );

			Encoding.ASCII.GetBytes( value, 0, length, m_Stream.GetBuffer(), (int)m_Stream.Position );
			m_Stream.Position += length + 1;

			/*byte[] buffer = Encoding.ASCII.GetBytes( value );

			m_Stream.Write( buffer, 0, buffer.Length );
			m_Stream.WriteByte( 0 );*/
		}