View NET35_ArrayPool.cs
// This code is borrowed from corefx/System.Buffers and modified for .NET 3.5
// https://github.com/dotnet/corefx/tree/master/src/System.Buffers/src/System/Buffers
using System.Threading;
namespace System.Buffers
{
/// <summary>
/// Provides a resource pool that enables reusing instances of type <see cref="T:T[]"/>.
/// </summary>
View ReadNextBlockSegment.cs
using System;
using Utf8Json.Internal;
using Xunit;
namespace Utf8Json.Tests
{
public class ReadNextBlockSegmentTest
{
[JsonFormatter(typeof(ContainerFormatter))]
public class Container
View UseAutomataDictionary.cs
// AutomataDictionaryを使う&むしろType無視してIValueだけで済ましてしまうパターン(こら
// reader.ReadObjectSegment/ReadArraySegmentがあって、小ブロックを取得できるようにすれば解決しそう(追加します
public class Container
{
public string Type { get; set; }
public IValue Value { get; set; }
}
View MemoryProfilerResolver.cs
/*
namespace UnityEditor.Profiler.Memory
{
using MessagePack;
using System;
[MessagePackObject]
public class PackedMemorySnapshot
{
View cloudstructures_redis.cs
using CloudStructures;
using MessagePack;
using MessagePack.Formatters;
using MessagePack.Resolvers;
using System;
using StackExchange.Redis;
using System.Text;
// Ivory is our project name:)
namespace Ivory.Redis
View jilvsutf8json.cs
using System;
using System.Collections.Generic;
using System.Text;
using Utf8Json;
using Jil;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Attributes.Jobs;
namespace PerfBenchmark
View benchmarkdotnettemplate.cs
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Exporters;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
class Program
{
static void Main(string[] args)
View StringSpan.cs
using System;
using System.Text;
public static class StringSplitExtensions
{
public static SplitCharEnumerator SplitSlice(this string str, char separator)
{
return new SplitCharEnumerator(str, separator);
}
View NumberConverter.cs
using System;
namespace MyNamespace
{
/// <summary>
/// UTF8(Ascii) ByteArray to Number Converter to avoid utf8 convert and number parsing.
/// </summary>
public static class NumberConverter
{
// loop unrolling(we know number length)
View PayloadFormatter.cs
public class PayloadFormatter : IMessagePackFormatter<Payload>
{
public Payload Deserialize(byte[] bytes, int offset, IFormatterResolver formatterResolver, out int readSize)
{
throw new NotSupportedException("まぁいらんでしょう。");
}
public int Serialize(ref byte[] bytes, int offset, Payload value, IFormatterResolver formatterResolver)
{
var startOffset = offset;