XNIO version 1.0.0.GA

org.jboss.xnio
Interface BufferAllocator<T extends Buffer>

Type Parameters:
T - the type of buffer that is managed by this allocator

public interface BufferAllocator<T extends Buffer>

An allocator for buffers.


Method Summary
 T allocate()
          Allocate a buffer.
 void free(T buffer)
          Free a previously allocated buffer.
 

Method Detail

allocate

T allocate()
Allocate a buffer. If not enough buffers are available to be allocated, return null.

Returns:
a buffer, or null if none are available

free

void free(T buffer)
Free a previously allocated buffer.

Parameters:
buffer - the buffer to free

XNIO version 1.0.0.GA

Copyright © 2008 JBoss, a division of Red Hat, Inc.