Skip to content

Commit

Permalink
#245: cast fix using JVMBridgeBase.Wraps (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
masesdevelopers authored Oct 5, 2023
1 parent 82d8b87 commit b8324e5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/net/KNet/Specific/Serialization/KNetSerialization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public static ByteBuffer DeserializeByteBuffer(string topic, byte[] data)
/// </summary>
public static Bytes DeserializeBytes(string topic, byte[] data)
{
return JVMBridgeBase.Wraps< Bytes>(_BytesDeserializer.Deserialize(topic, data) as IJavaObject);
return JVMBridgeBase.Wraps<Bytes>(_BytesDeserializer.Deserialize(topic, data) as IJavaObject);
}

static readonly DoubleDeserializer _DoubleDeserializer = new DoubleDeserializer();
Expand All @@ -272,7 +272,7 @@ public static Bytes DeserializeBytes(string topic, byte[] data)
/// </summary>
public static double DeserializeDouble(string topic, byte[] data)
{
return (double)_DoubleDeserializer.Deserialize(topic, data);
return JVMBridgeBase.Wraps<Java.Lang.Double>(_DoubleDeserializer.Deserialize(topic, data) as IJavaObject);
}

static readonly FloatDeserializer _FloatDeserializer = new FloatDeserializer();
Expand All @@ -281,7 +281,7 @@ public static double DeserializeDouble(string topic, byte[] data)
/// </summary>
public static float DeserializeFloat(string topic, byte[] data)
{
return (float)_FloatDeserializer.Deserialize(topic, data);
return JVMBridgeBase.Wraps<Java.Lang.Float>(_FloatDeserializer.Deserialize(topic, data) as IJavaObject);
}

static readonly IntegerDeserializer _IntDeserializer = new IntegerDeserializer();
Expand All @@ -290,7 +290,7 @@ public static float DeserializeFloat(string topic, byte[] data)
/// </summary>
public static int DeserializeInt(string topic, byte[] data)
{
return (int)_IntDeserializer.Deserialize(topic, data);
return JVMBridgeBase.Wraps<Java.Lang.Integer>(_IntDeserializer.Deserialize(topic, data) as IJavaObject);

//if (data == null)
//{
Expand Down Expand Up @@ -324,7 +324,7 @@ public static int DeserializeInt(string topic, byte[] data)
/// </summary>
public static long DeserializeLong(string topic, byte[] data)
{
return (long)_LongDeserializer.Deserialize(topic, data);
return JVMBridgeBase.Wraps<Java.Lang.Long>(_LongDeserializer.Deserialize(topic, data) as IJavaObject);

//if (data == null)
//{
Expand Down Expand Up @@ -358,7 +358,7 @@ public static long DeserializeLong(string topic, byte[] data)
/// </summary>
public static short DeserializeShort(string topic, byte[] data)
{
return (short)_ShortDeserializer.Deserialize(topic, data);
return JVMBridgeBase.Wraps<Java.Lang.Short>(_ShortDeserializer.Deserialize(topic, data) as IJavaObject);

//if (data == null)
//{
Expand Down

0 comments on commit b8324e5

Please sign in to comment.