public void WriteAsciiFixed( string value, int size )
{
if ( value == null )
{
Console.WriteLine( "Network: Attempted to WriteAsciiFixed() with null value" );
value = String.Empty;
}
int length = value.Length;
m_Stream.SetLength( m_Stream.Length + size );
if ( length >= size )
m_Stream.Position += Encoding.ASCII.GetBytes( value, 0, size, m_Stream.GetBuffer(), (int)m_Stream.Position );
else
{
Encoding.ASCII.GetBytes( value, 0, length, m_Stream.GetBuffer(), (int)m_Stream.Position );
m_Stream.Position += size;
}
/*byte[] buffer = Encoding.ASCII.GetBytes( value );
if ( buffer.Length >= size )
{
m_Stream.Write( buffer, 0, size );
}
else
{
m_Stream.Write( buffer, 0, buffer.Length );
Fill( size - buffer.Length );
}*/
}