Skip to main content

BufferPool

Courtesy of @marcgravell https://github.com/mgravell/protobuf-net/blob/master/src/protobuf-net/BufferPool.cs

Assembly: ServiceStack.Text.dll
View Source
Declaration
public sealed class BufferPool

Fields

BUFFER_LENGTH

View Source
Declaration
public const int BUFFER_LENGTH = 1450

Methods

Flush()

View Source
Declaration
public static void Flush()

GetBuffer()

View Source
Declaration
public static byte[] GetBuffer()
Returns

System.Byte[]

GetBuffer(Int32)

View Source
Declaration
public static byte[] GetBuffer(int minSize)
Returns

System.Byte[]

Parameters
TypeName
System.Int32minSize

GetCachedBuffer(Int32)

View Source
Declaration
public static byte[] GetCachedBuffer(int minSize)
Returns

System.Byte[]

Parameters
TypeName
System.Int32minSize

ResizeAndFlushLeft(ref Byte[], Int32, Int32, Int32)

View Source
Declaration
public static void ResizeAndFlushLeft(ref byte[] buffer, int toFitAtLeastBytes, int copyFromIndex, int copyBytes)
Parameters
TypeName
System.Byte[]buffer
System.Int32toFitAtLeastBytes
System.Int32copyFromIndex
System.Int32copyBytes

ReleaseBufferToPool(ref Byte[])

View Source
Declaration
public static void ReleaseBufferToPool(ref byte[] buffer)
Parameters
TypeName
System.Byte[]buffer