CodeImp.Gluon.RemoteCommand.WriteTo C# (CSharp) Метод

WriteTo() публичный Метод

public WriteTo ( Stream stream ) : void
stream Stream
Результат void
        public void WriteTo(Stream stream)
        {
            StreamWriter writer = new StreamWriter(stream, Encoding.ASCII);
            stream.Seek(0, SeekOrigin.End);

            // Write the header
            writer.Write(source);
            writer.Write(" ");
            writer.Write(target);
            writer.Write(" ");
            writer.Write(command);
            writer.Write(" ");
            writer.Write(data.Length);
            writer.Write(" ");
            writer.Flush();

            // Write the data
            if(data.Length > 0)
                stream.Write(data, 0, data.Length);
        }

Usage Example

Пример #1
0
 // This sends a command to the client
 public void SendCommand(RemoteCommand cmd)
 {
     cmd.WriteTo(sendbuffer);
 }
All Usage Examples Of CodeImp.Gluon.RemoteCommand::WriteTo