WriteNull() public abstract method

Writes a null value to the stream. The null will be written with the following syntax N
public abstract WriteNull ( ) : void
return void
コード例 #1
0
        /// <summary>
        /// Writes enum to the output stream
        /// </summary>
        /// <param name="obj"> Enum to write</param>
        /// <param name="abstractHessianOutput">Instance of the hessian output</param>
        public override void WriteObject(object obj, AbstractHessianOutput abstractHessianOutput)
        {
            // immer den Referenzzähler hochzählen!
            // (manche enums mit nullable funktionieren nicht)
            object unrefobj = new object();

            if (abstractHessianOutput.AddRef(unrefobj))
            {
                return;
            }

            if (obj == null)
            {
                abstractHessianOutput.WriteNull();
            }
            else
            {
                Type   enumType = obj.GetType();
                string name     =                         //Enum.GetName(enumType, obj);
                                  ((Enum)obj).ToString(); // das geht auch mit .NET Mobile
                abstractHessianOutput.WriteMapBegin(enumType.FullName);
                abstractHessianOutput.WriteObject("name");
                abstractHessianOutput.WriteObject(name);
                abstractHessianOutput.WriteMapEnd();
            }
        }
コード例 #2
0
 /// <summary>
 /// Writes Instance of the DateTime class
 /// </summary>
 /// <param name="objDate">Instance of the DateTime class</param>
 /// <param name="abstractHessianOutput">HessianOutput - Stream</param>
 public override void WriteObject(Object objDate, AbstractHessianOutput abstractHessianOutput)
 {
     if (objDate == null)
         abstractHessianOutput.WriteNull();
     else
     {
         abstractHessianOutput.WriteUTCDate(MakeJavaDate((DateTime)objDate));
     }
 }
コード例 #3
0
 /// <summary>
 /// Writes Instance of the DateTime class
 /// </summary>
 /// <param name="objDate">Instance of the DateTime class</param>
 /// <param name="abstractHessianOutput">HessianOutput - Stream</param>
 public override void WriteObject(Object objDate, AbstractHessianOutput abstractHessianOutput)
 {
     if (objDate == null)
     {
         abstractHessianOutput.WriteNull();
     }
     else
     {
         abstractHessianOutput.WriteUTCDate(MakeJavaDate((DateTime)objDate));
     }
 }
コード例 #4
0
 /// <summary>
 /// Writes Instance of the DateTime class
 /// </summary>
 /// <param name="objDate">Instance of the DateTime class</param>
 /// <param name="abstractHessianOutput">HessianOutput - Stream</param>
 public override void WriteObject(Object objDate, AbstractHessianOutput abstractHessianOutput)
 {
     if (objDate == null)
         abstractHessianOutput.WriteNull();
     else
     {
         /*Type type = objDate.GetType();
         abstractHessianOutput.WriteMapBegin(type.FullName);
         abstractHessianOutput.WriteString("value");
         abstractHessianOutput.WriteUTCDate(((((DateTime) objDate).Ticks - ticksDifference) / ticksDivider) - (long) TimeZone.CurrentTimeZone.GetUtcOffset(((DateTime) objDate)).TotalMilliseconds);
         abstractHessianOutput.WriteMapEnd();
         */
         abstractHessianOutput.WriteUTCDate(MakeJavaDate((DateTime)objDate));
         //abstractHessianOutput.WriteUTCDate(((DateTime)objDate).ToFileTimeUtc());
     }
 }
コード例 #5
0
        /// <summary>
        /// Serialization of stream valued objects
        /// </summary>
        /// <param name="obj">Object to serialize</param>
        /// <param name="abstractHessianOutput">HessianOutput - Instance</param>
        public override void WriteObject(object obj, AbstractHessianOutput abstractHessianOutput)
        {
            Stream inStream = (Stream) obj;

            if (inStream == null)
                abstractHessianOutput.WriteNull();
            else
            {
                byte[] buf = new byte[1024];
                int len;
                while ((len = inStream.Read(buf, 0, buf.Length)) > 0)
                {
                    abstractHessianOutput.WriteByteBufferPart(buf, 0, len);
                }
                abstractHessianOutput.WriteByteBufferEnd(buf, 0, 0);
            }
        }
コード例 #6
0
        /// <summary>
        /// Serialization of stream valued objects
        /// </summary>
        /// <param name="obj">Object to serialize</param>
        /// <param name="abstractHessianOutput">HessianOutput - Instance</param>
        public override void WriteObject(object obj, AbstractHessianOutput abstractHessianOutput)
        {
            Stream inStream = (Stream)obj;

            if (inStream == null)
            {
                abstractHessianOutput.WriteNull();
            }
            else
            {
                byte[] buf = new byte[1024];
                int    len;
                while ((len = inStream.Read(buf, 0, buf.Length)) > 0)
                {
                    abstractHessianOutput.WriteByteBufferPart(buf, 0, len);
                }
                abstractHessianOutput.WriteByteBufferEnd(buf, 0, 0);
            }
        }
コード例 #7
0
        /// <summary>
        /// Writes enum to the output stream
        /// </summary>
        /// <param name="obj"> Enum to write</param>
        /// <param name="abstractHessianOutput">Instance of the hessian output</param>
        public override void WriteObject(object obj, AbstractHessianOutput abstractHessianOutput)
        {
            // immer den Referenzzähler hochzählen!
            // (manche enums mit nullable funktionieren nicht)
            object unrefobj = new object();
            if (abstractHessianOutput.AddRef(unrefobj))
                return;

            if (obj == null)
            {
                abstractHessianOutput.WriteNull();
            }
            else
            {
                Type enumType = obj.GetType();
                string name = //Enum.GetName(enumType, obj);
                    ((Enum)obj).ToString(); // das geht auch mit .NET Mobile
                abstractHessianOutput.WriteMapBegin(enumType.FullName);
                abstractHessianOutput.WriteObject("name");
                abstractHessianOutput.WriteObject(name);
                abstractHessianOutput.WriteMapEnd();
            }
        }