com.mucommander.io
Class BufferPool.ByteBufferFactory

java.lang.Object
  extended by com.mucommander.io.BufferPool.BufferFactory
      extended by com.mucommander.io.BufferPool.ByteBufferFactory
Enclosing class:
BufferPool

public static class BufferPool.ByteBufferFactory
extends BufferPool.BufferFactory

This class is a BufferPool.BufferFactory implementation for java.nio.ByteBuffer buffers. The ByteBuffer instances created by newBuffer(int) are direct ; the actually Class of those instances may be actually be java.nio.DirectByteBuffer and not java.nio.ByteBuffer as returned by getBufferClass().


Constructor Summary
BufferPool.ByteBufferFactory()
           
 
Method Summary
protected  java.lang.Class getBufferClass()
          Returns the Class of buffer instances this factory creates.
protected  java.lang.Object newBuffer(int size)
          Creates and returns a buffer instance of the specified size.
protected  BufferPool.BufferContainer newBufferContainer(java.lang.Object buffer)
          Creates and returns a BufferPool.BufferContainer for the specified buffer instance.
 
Methods inherited from class com.mucommander.io.BufferPool.BufferFactory
matchesBufferClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferPool.ByteBufferFactory

public BufferPool.ByteBufferFactory()
Method Detail

newBuffer

protected java.lang.Object newBuffer(int size)
Description copied from class: BufferPool.BufferFactory
Creates and returns a buffer instance of the specified size.

Specified by:
newBuffer in class BufferPool.BufferFactory
Parameters:
size - size of the buffer to create
Returns:
a buffer instance of the specified size

newBufferContainer

protected BufferPool.BufferContainer newBufferContainer(java.lang.Object buffer)
Description copied from class: BufferPool.BufferFactory
Creates and returns a BufferPool.BufferContainer for the specified buffer instance.

Specified by:
newBufferContainer in class BufferPool.BufferFactory
Parameters:
buffer - the buffer to wrap in a BufferContainer
Returns:
returns a BufferContainer for the specified buffer instance

getBufferClass

protected java.lang.Class getBufferClass()
Description copied from class: BufferPool.BufferFactory
Returns the Class of buffer instances this factory creates.

Specified by:
getBufferClass in class BufferPool.BufferFactory
Returns:
the Class of buffer instances this factory creates


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard