Exemple #1
0
        public override bool Pack(UdpStream stream, ref object o)
        {
            // cast to string and get bytes
            byte[] bytes = (byte[])(o);

            // write length and bytes into buffer
            stream.WriteInt(bytes.Length);
            stream.WriteByteArray(bytes);

            return(true);
        }
Exemple #2
0
        public override bool Pack(UdpStream stream, ref object o)
        {
            // cast to string and get bytes
            string msg = (string) o;
            byte[] bytes = Encoding.UTF8.GetBytes(msg);

            // write length and bytes into buffer
            stream.WriteInt(bytes.Length);
            stream.WriteByteArray(bytes);

            return true;
        }
Exemple #3
0
        public override bool Pack(UdpStream stream, ref object o)
        {
            // cast to string and get bytes
            string msg = (string)o;

            byte[] bytes = Encoding.UTF8.GetBytes(msg);

            // write length and bytes into buffer
            stream.WriteInt(bytes.Length);
            stream.WriteByteArray(bytes);

            return(true);
        }