internal static ComponentSerializer Get() { ComponentSerializer serializer = (ComponentSerializer) _stack.Pop(); if (serializer == null) { serializer = new ComponentSerializer(); } return serializer; }
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); }
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); }
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); }
internal static ComponentSerializer Get() { ComponentSerializer serializer = (ComponentSerializer)_stack.Pop(); if (serializer == null) { serializer = new ComponentSerializer(); } return(serializer); }
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); }
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); }
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); }