You've already forked com.unity.ide.cursor
mirror of
https://github.com/boxqkrtm/com.unity.ide.cursor.git
synced 2026-05-15 14:50:08 +00:00
## [2.0.7] - 2021-02-02 Integration: Remove com.unity.nuget.newtonsoft-json dependency in favor of the built-in JsonUtility for the VS Test Runner. ## [2.0.6] - 2021-01-20 Project generation: - Improved language version detection. Integration: - Added support for the VS Test Runner. - Added initial support for displaying asset usage. - Fixed remaining issues with special characters in file/path.
38 lines
955 B
C#
38 lines
955 B
C#
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
using System.IO;
|
|
using System.Text;
|
|
|
|
namespace Microsoft.Unity.VisualStudio.Editor.Messaging
|
|
{
|
|
internal class Deserializer
|
|
{
|
|
private readonly BinaryReader _reader;
|
|
|
|
public Deserializer(byte[] buffer)
|
|
{
|
|
_reader = new BinaryReader(new MemoryStream(buffer));
|
|
}
|
|
|
|
public int ReadInt32()
|
|
{
|
|
return _reader.ReadInt32();
|
|
}
|
|
|
|
public string ReadString()
|
|
{
|
|
var length = ReadInt32();
|
|
return length > 0
|
|
? Encoding.UTF8.GetString(_reader.ReadBytes(length))
|
|
: "";
|
|
}
|
|
|
|
public bool CanReadMore()
|
|
{
|
|
return _reader.BaseStream.Position < _reader.BaseStream.Length;
|
|
}
|
|
}
|
|
}
|