Skip to content

Instantly share code, notes, and snippets.

View sokuhatiku's full-sized avatar

Sokuhatiku sokuhatiku

View GitHub Profile
@ahsonkhan
ahsonkhan / ArrayBufferWriter.ArrayPool.cs
Created January 29, 2019 01:11
Sample implementation of ArrayBufferWriter, a class that implements IBufferWriter<byte> backed by ArrayPool<byte>.Shared.
public class ArrayBufferWriter : IBufferWriter<byte>, IDisposable
{
private byte[] _rentedBuffer;
private int _written;
private long _committed;
private const int MinimumBufferSize = 256;
public ArrayBufferWriter(int initialCapacity = MinimumBufferSize)
{
@jhorsman
jhorsman / semver-regex.md
Last active March 29, 2024 05:25
Semantic versioning regex