bigloo.binary_port.output_obj C# (CSharp) Method

output_obj() public method

public output_obj ( Object obj ) : obj
obj Object
return obj
        public obj output_obj( Object  obj )
        {
            // the magic key
            byte[] _string= foreign.__cb__.obj_to_string( obj );

            stream.Write( MAGIC_WORD, 0, 4 );

            // the object length
            byte[] slen= new byte[4];
            int clen= _string.Length;

            slen[0]= (byte)clen;
            slen[1]= (byte)(clen >> 8);
            slen[2]= (byte)(clen >> 16);
            slen[3]= (byte)(clen >> 24);

            stream.Write( slen, 0, 4 );

            // the serialized object
            stream.Write( _string, 0, clen );

            return this;
        }

Usage Example

示例#1
0
 public static Object output_obj( binary_port p, Object obj )
 {
     return p.output_obj( obj );
 }