Beispiel #1
0
        private void EncodeObjectInfoCollection(ByteArrayOutputStream os, IObjectInfoCollection
                                                collection, MCommittedInfo.IObjectInfoEncoder encoder)
        {
            IEnumerator iter = collection.GetEnumerator();

            while (iter.MoveNext())
            {
                IObjectInfo obj = (IObjectInfo)iter.Current;
                encoder.Encode(os, obj);
            }
            PrimitiveCodec.WriteLong(os, -1);
        }
Beispiel #2
0
        private IObjectInfoCollection DecodeObjectInfoCollection(ByteArrayInputStream @is
                                                                 , MCommittedInfo.IObjectInfoEncoder encoder)
        {
            Collection4 collection = new Collection4();

            while (true)
            {
                IObjectInfo info = encoder.Decode(@is);
                if (null == info)
                {
                    break;
                }
                collection.Add(info);
            }
            return(new ObjectInfoCollectionImpl(collection));
        }