Beispiel #1
0
        public static ISerializer <Input, Output> Create <Input, Output>(global::Bond.ProtocolType protocol, bool marshal)
            where Input : IInputStream, global::Bond.IO.ICloneable <Input>
            where Output : IOutputStream
        {
            switch (protocol)
            {
            case global::Bond.ProtocolType.COMPACT_PROTOCOL:
                return(marshal ? (ISerializer <Input, Output>) new CompactBinaryMarshaler <Input, Output>() : new CompactBinarySerializer <Input, Output>());

            case global::Bond.ProtocolType.FAST_PROTOCOL:
                return(marshal ? (ISerializer <Input, Output>) new FastBinaryMarshaler <Input, Output>() : new FastBinarySerializer <Input, Output>());

            case global::Bond.ProtocolType.SIMPLE_PROTOCOL:
                return(marshal ? (ISerializer <Input, Output>) new SimpleBinaryMarshaler <Input, Output>() : new SimpleBinarySerializer <Input, Output>());
            }

            throw new IPC.Managed.Exception("Unknown protocol.");
        }
Beispiel #2
0
 public Serializer(global::Bond.ProtocolType protocol)
 {
     ProtocolType = protocol;
 }
Beispiel #3
0
 public Marshaler(global::Bond.ProtocolType protocol)
 {
     ProtocolType = protocol;
 }
Beispiel #4
0
 public Serializer(global::Bond.ProtocolType protocol, bool marshal, BufferPool pool, SharedMemory inputMemory, uint minBlobSize = 0)
     : this(SerializerFactory.Create <InputStream, OutputStream>(protocol, marshal), pool, inputMemory, minBlobSize)
 {
 }