THRIFT-1930: C# generates unsigned byte for Thrift "byte" type
Patch: Jens Geyer
diff --git a/lib/csharp/src/Protocol/TJSONProtocol.cs b/lib/csharp/src/Protocol/TJSONProtocol.cs
index ed6970e..f583781 100644
--- a/lib/csharp/src/Protocol/TJSONProtocol.cs
+++ b/lib/csharp/src/Protocol/TJSONProtocol.cs
@@ -672,7 +672,7 @@
WriteJSONInteger(b ? (long)1 : (long)0);
}
- public override void WriteByte(byte b)
+ public override void WriteByte(sbyte b)
{
WriteJSONInteger((long)b);
}
@@ -1033,9 +1033,9 @@
return (ReadJSONInteger() == 0 ? false : true);
}
- public override byte ReadByte()
+ public override sbyte ReadByte()
{
- return (byte)ReadJSONInteger();
+ return (sbyte)ReadJSONInteger();
}
public override short ReadI16()