Files
com.unity.ide.cursor/Editor/Messaging/Serializer.cs
Unity Technologies fb1154211c com.unity.ide.visualstudio@2.0.0
## [2.0.0] - 2019-11-06

- Improved Visual Studio and Visual Studio for Mac automatic discovery
- Added support for the VSTU messaging system (start/stop features from Visual Studio)
- Added support for solution roundtrip (preserves references to external projects and solution properties)
- Added support for VSTU Analyzers (requires Visual Studio 2019 16.3, Visual Studio for Mac 8.3)
- Added a warning when using legacy pdb symbol files.
- Fixed issues while Opening Visual Studio on Windows
- Fixed issues while Opening Visual Studio on Mac

## [1.1.1] - 2019-05-29

Fix Bridge assembly loading with non VS2017 editors

## [1.1.0] - 2019-05-27

Move internal extension handling to package.
2019-11-06 00:00:00 +00:00

44 lines
1013 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 Serializer
{
private readonly MemoryStream _stream;
private readonly BinaryWriter _writer;
public Serializer()
{
_stream = new MemoryStream();
_writer = new BinaryWriter(_stream);
}
public void WriteInt32(int i)
{
_writer.Write(i);
}
public void WriteString(string s)
{
var bytes = Encoding.UTF8.GetBytes(s ?? "");
if (bytes.Length > 0)
{
_writer.Write(bytes.Length);
_writer.Write(bytes);
}
else
_writer.Write(0);
}
public byte[] Buffer()
{
return _stream.ToArray();
}
}
}