Interface IBufferManager
- Namespace
- Microsoft.WindowsAzure.Storage
- Assembly
- Microsoft.WindowsAzure.Storage.dll
An interface that allows clients to provide a buffer manager to a given service client. This interface is patterned after the System.ServiceModel.Channels.BufferManager class.
public interface IBufferManager
Methods
GetDefaultBufferSize()
Gets the size, in bytes, of the buffers managed by the given pool. Note that the buffer manager must return buffers of the exact size requested by the client.
int GetDefaultBufferSize()
Returns
- int
The size, in bytes, of the buffers managed by the given pool.
ReturnBuffer(byte[])
Returns a buffer to the pool.
void ReturnBuffer(byte[] buffer)
Parameters
buffer
byte[]A byte array specifying the buffer to return to the pool.
Exceptions
- ArgumentNullException
Buffer reference cannot be null.
- ArgumentException
Length of buffer does not match the pool's buffer length property.
TakeBuffer(int)
Gets a buffer of the specified size or larger from the pool.
byte[] TakeBuffer(int bufferSize)
Parameters
bufferSize
intThe size, in bytes, of the requested buffer.
Returns
- byte[]
A byte array that is the requested size of the buffer.
Exceptions
- ArgumentOutOfRangeException
The value specified for
bufferSize
cannot be less than zero.