public void WriteData(IObjectDataOutput output)
 {
     output.WriteBoolean(Bool);
     output.WriteBooleanArray(BoolArray);
     output.WriteByte(Byte);
     output.WriteByteArray(ByteArray);
     output.WriteChar(Char);
     output.WriteCharArray(CharArray);
     output.WriteShort(Short);
     output.WriteShortArray(ShortArray);
     output.WriteInt(Int);
     output.WriteIntArray(IntArray);
     output.WriteLong(Long);
     output.WriteLongArray(LongArray);
     output.WriteFloat(Float);
     output.WriteFloatArray(FloatArray);
     output.WriteDouble(Double);
     output.WriteDoubleArray(DoubleArray);
     output.WriteObject(Serializable);
     //output.WriteObject(SerializableArray);
     //output.WriteObject(Portable);
     //output.WriteObject(PortableArray);
     output.WriteInt(Chars.Length);
     output.WriteChars(Chars);
     output.WriteUTF(String);
     output.WriteUTFArray(StringArray);
     output.WriteObject(DateTime);
 }
        /// <exception cref="System.IO.IOException"></exception>
        public void Write(IObjectDataOutput output, IDataSerializable obj)
        {
            bool identified = obj is IIdentifiedDataSerializable;

            output.WriteBoolean(identified);
            if (identified)
            {
                var ds = (IIdentifiedDataSerializable)obj;
                output.WriteInt(ds.GetFactoryId());
                output.WriteInt(ds.GetId());
            }
            else
            {
                string javaClassName = obj.GetJavaClassName();

                class2Type.AddOrUpdate(javaClassName, obj.GetType(), (s, type) => obj.GetType());
                output.WriteUTF(javaClassName);
            }
            obj.WriteData(output);
        }
 public void Write(IObjectDataOutput output, object obj)
 {
     if (obj is IList <string> )
     {
         IList <string> list = (IList <string>)obj;
         output.WriteInt(list.Count);
         foreach (var o in list)
         {
             output.WriteUTF(o);
         }
     }
 }
Beispiel #4
0
            public void Write(IObjectDataOutput output, CollectionType obj)
            {
                var size = obj.Count;

                output.WriteInt(size);
                if (size > 0)
                {
                    foreach (var o in obj)
                    {
                        output.WriteObject(o);
                    }
                }
            }
Beispiel #5
0
        public void Write(IObjectDataOutput output, DType obj)
        {
            var size = obj.Count;

            output.WriteInt(size);
            if (size > 0)
            {
                foreach (var kvp in obj)
                {
                    output.WriteObject(kvp.Key);
                    output.WriteObject(kvp.Value);
                }
            }
        }
Beispiel #6
0
        public void Write(IObjectDataOutput output, Person t)
        {
            byte[] array;
            var    bf = new BinaryFormatter();

            using (var ms = new MemoryStream())
            {
                bf.Serialize(ms, t);
                array = ms.ToArray();
            }

            output.WriteInt(array.Length);
            output.Write(array);
        }
Beispiel #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="output"></param>
        public void WriteData(IObjectDataOutput output)
        {
            output.WriteObject(_predicate);
            output.WriteObject(_comparer);
            output.WriteInt(_page);
            output.WriteInt(_pageSize);
            output.WriteUTF(_iterationType.ToString());

            if (_anchorList != null)
            {
                output.WriteInt(_anchorList.Count);
                foreach (KeyValuePair <int, KeyValuePair <TKey, TValue> > anchor in _anchorList)
                {
                    output.WriteInt(anchor.Key);
                    KeyValuePair <TKey, TValue> anchorEntry = anchor.Value;
                    output.WriteObject(anchorEntry.Key);
                    output.WriteObject(anchorEntry.Value);
                }
            }
            else
            {
                output.WriteInt(0);
            }
        }
 public void WriteObject(IObjectDataOutput output, object obj)
 {
     if (obj is IData)
     {
         throw new HazelcastSerializationException(
                   "Cannot write a Data instance! Use #writeData(ObjectDataOutput out, Data data) instead.");
     }
     try
     {
         var serializer = SerializerFor(obj);
         output.WriteInt(serializer.GetTypeId());
         serializer.Write(output, obj);
     }
     catch (Exception e)
     {
         throw HandleException(e);
     }
 }
 public virtual void WriteData(IObjectDataOutput @out)
 {
     @out.WriteString(street);
     @out.WriteInt(no);
 }
 public void WriteData(IObjectDataOutput output)
 {
     output.WriteInt(data.Length);
     output.Write(data);
 }
 public void WriteData(IObjectDataOutput output)
 {
     output.WriteUTF(_attributeName);
     output.WriteInt(_values.Length);
     foreach (var value in _values)
     {
         output.WriteObject(value);
     }
 }
Beispiel #12
0
 public void WriteData(IObjectDataOutput output)
 {
     output.WriteInt(data.Length);
     output.Write(data);
 }
 public void WriteData(IObjectDataOutput output)
 {
     output.WriteInt(Id);
     output.WriteUTF(Name);
 }
 public void WriteData(IObjectDataOutput output)
 {
     output.WriteInt(_runnerCount);
     output.WriteInt(_raceCount);
     for (int i = 0; i < _runnerCount; i++)
     {
         for (int j = 0; j < _raceCount; j++)
         {
             _runnerInfos[i, j].WriteData(output);
         }
     }
 }
 public void WriteData(IObjectDataOutput output)
 {
     output.WriteInt(i);
     output.WriteChar(c);
 }
 public void WriteData(IObjectDataOutput output)
 {
     output.WriteInt(_predicates.Length);
     foreach (var predicate in _predicates)
     {
         output.WriteObject(predicate);
     }
 }
 public void WriteData(IObjectDataOutput output)
 {
     output.WriteInt(i);
     output.WriteChar(c);
 }
 public void WriteData(IObjectDataOutput output)
 {
     output.WriteInt(_type);
     output.WriteInt((int)_iterationType);
 }
 public void WriteData(IObjectDataOutput output)
 {
     output.WriteInt(Id);
     output.WriteUTF(Name);
 }
 public virtual void WriteData(IObjectDataOutput @out)
 {
     @out.WriteUTF(street);
     @out.WriteInt(no);
 }
Beispiel #21
0
 /// <exception cref="System.IO.IOException"></exception>
 public override void Write(IObjectDataOutput output, int obj)
 {
     output.WriteInt(obj);
 }
 /// <exception cref="System.IO.IOException" />
 public virtual void WriteData(IObjectDataOutput @out)
 {
     @out.WriteUTF(name);
     @out.WriteObject(address);
     @out.WriteInt(age);
     @out.WriteLong(height);
     @out.WriteDouble(weight);
 }