diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.cs index ae5a50369..a75917b0b 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.cs @@ -440,7 +440,7 @@ private static T DeserializeFromSequenceAndRewindStreamIfPossible(Stream stre if (streamToRewind.CanSeek && !reader.End) { // Reverse the stream as many bytes as we left unread. - int bytesNotRead = checked((int)reader.Sequence.Slice(reader.Position).Length); + long bytesNotRead = reader.Sequence.Slice(reader.Position).Length; streamToRewind.Seek(-bytesNotRead, SeekOrigin.Current); }