예제 #1
0
        internal static string ConvertToString(IMessage reqMsg)
        {
            long num;
            ComponentSerializer serializer = ComponentSerializer.Get();
            string str = GetString(serializer.MarshalToBuffer(reqMsg, out num), (int)num);

            serializer.Release();
            return(str);
        }
예제 #2
0
        internal static IMessage ConvertToReturnMessage(String s, IMessage mcMsg)
        {
            ComponentSerializer serializer = ComponentSerializer.Get();

            byte[]   byteArray = _encoder.GetBytes(s);
            IMessage retMsg    = (IMessage)serializer.UnmarshalReturnMessageFromBuffer(byteArray, (IMethodCallMessage)mcMsg);

            serializer.Release();
            return(retMsg);
        }
예제 #3
0
        internal static IMessage ConvertToMessage(String s, Object tp)
        {
            ComponentSerializer serializer = ComponentSerializer.Get();

            byte[]   byteArray = _encoder.GetBytes(s);
            IMessage retMsg    = (IMessage)serializer.UnmarshalFromBuffer(byteArray, tp);

            serializer.Release();
            return(retMsg);
        }
예제 #4
0
        internal static IMessage ConvertToReturnMessage(string s, IMessage mcMsg)
        {
            ComponentSerializer serializer = ComponentSerializer.Get();

            byte[]   bytes   = GetBytes(s);
            IMessage message = (IMessage)serializer.UnmarshalReturnMessageFromBuffer(bytes, (IMethodCallMessage)mcMsg);

            serializer.Release();
            return(message);
        }
예제 #5
0
        internal static IMessage ConvertToMessage(string s, object tp)
        {
            ComponentSerializer serializer = ComponentSerializer.Get();

            byte[]   bytes   = GetBytes(s);
            IMessage message = (IMessage)serializer.UnmarshalFromBuffer(bytes, tp);

            serializer.Release();
            return(message);
        }
예제 #6
0
        internal static String ConvertToString(IMessage reqMsg)
        {
            ComponentSerializer serializer = ComponentSerializer.Get();
            long numBytes;

            byte[] byteArray = serializer.MarshalToBuffer(reqMsg, out numBytes);
            String s         = _encoder.GetString(byteArray, 0, (int)numBytes); // downcast should be ok, looks like MemoryStream internally uses an int anyway

            serializer.Release();
            return(s);
        }