com.cosylab.epics.caj.impl
Class CachedByteBufferAllocator

java.lang.Object
  extended by com.cosylab.epics.caj.impl.CachedByteBufferAllocator

public class CachedByteBufferAllocator
extends Object

A buffer allocator which allocates and caches NIO (direct) byte buffers.

Version:
$id$
Author:
Matej Sekoranja

Field Summary
static int bufferSize
          This variable stores the size of the NIO byte buffer that should be allocated according to properties.
 
Constructor Summary
CachedByteBufferAllocator()
           
 
Method Summary
 ByteBuffer get()
          Get a byte buffer.
 void put(ByteBuffer buffer)
          Return buffer to a cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bufferSize

public static int bufferSize
This variable stores the size of the NIO byte buffer that should be allocated according to properties.

Constructor Detail

CachedByteBufferAllocator

public CachedByteBufferAllocator()
Method Detail

get

public ByteBuffer get()
Get a byte buffer.

Returns:
a byte buffer.

put

public void put(ByteBuffer buffer)
Return buffer to a cache.

Parameters:
buffer - buffer to be returned in the cache.


Copyright © 2004-2013 Cosylab. All Rights Reserved.