net.sf.asyncobjects.io
Class DefaultBufferProvider

java.lang.Object
  extended by net.sf.asyncobjects.io.DefaultBufferProvider
All Implemented Interfaces:
BufferProvider

public class DefaultBufferProvider
extends Object
implements BufferProvider

A default buffer provider. It keeps buffers in itself.

Author:
const

Constructor Summary
DefaultBufferProvider(int byteBufferSize, int charBufferSize)
          A default constructor
 
Method Summary
 ByteBuffer getByteBuffer()
           
 CharBuffer getCharBuffer()
           
 void returnByteBuffer(ByteBuffer buffer)
          Return the buffer
 void returnCharBuffer(CharBuffer buffer)
          Return the buffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBufferProvider

public DefaultBufferProvider(int byteBufferSize,
                             int charBufferSize)
A default constructor

Parameters:
byteBufferSize - byte buffer size
charBufferSize - character buffer size
Method Detail

getByteBuffer

public ByteBuffer getByteBuffer()
Specified by:
getByteBuffer in interface BufferProvider
Returns:
a byte buffer
See Also:
BufferProvider.getByteBuffer()

getCharBuffer

public CharBuffer getCharBuffer()
Specified by:
getCharBuffer in interface BufferProvider
Returns:
a character buffer
See Also:
BufferProvider.getCharBuffer()

returnByteBuffer

public void returnByteBuffer(ByteBuffer buffer)
Description copied from interface: BufferProvider
Return the buffer

Specified by:
returnByteBuffer in interface BufferProvider
Parameters:
buffer - a buffer recieved with BufferProvider.getByteBuffer()
See Also:
BufferProvider.returnByteBuffer(java.nio.ByteBuffer)

returnCharBuffer

public void returnCharBuffer(CharBuffer buffer)
Description copied from interface: BufferProvider
Return the buffer

Specified by:
returnCharBuffer in interface BufferProvider
Parameters:
buffer - a buffer recieved with BufferProvider.getCharBuffer()
See Also:
BufferProvider.returnCharBuffer(java.nio.CharBuffer)


Copyright 2002-2007 Constantine Plotnikov. All Rights Reserved.