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
Type | Name |
---|---|
System.Int32 | minSize |
GetCachedBuffer(Int32)
View Source
Declaration
public static byte[] GetCachedBuffer(int minSize)
Returns
System.Byte[]
Parameters
Type | Name |
---|---|
System.Int32 | minSize |
ResizeAndFlushLeft(ref Byte[], Int32, Int32, Int32)
View Source
Declaration
public static void ResizeAndFlushLeft(ref byte[] buffer, int toFitAtLeastBytes, int copyFromIndex, int copyBytes)
Parameters
Type | Name |
---|---|
System.Byte[] | buffer |
System.Int32 | toFitAtLeastBytes |
System.Int32 | copyFromIndex |
System.Int32 | copyBytes |
ReleaseBufferToPool(ref Byte[])
View Source
Declaration
public static void ReleaseBufferToPool(ref byte[] buffer)
Parameters
Type | Name |
---|---|
System.Byte[] | buffer |