// ByteBufferPool.java

package ed.util;

import java.nio.*;

public class ByteBufferPool extends SimplePool<ByteBuffer> {

    public ByteBufferPool( int maxToKeep , int size ){
        super( "ByteBufferPool" , maxToKeep , -1  );
        _size = size;
    }

    public ByteBuffer createNew(){
        return ByteBuffer.allocateDirect( _size );
    }

    public boolean ok( ByteBuffer buf ){
        buf.position( 0 );
        buf.limit( buf.capacity() );
        return true;
    }    

    final int _size;
}

@@ -168,24 +168,145 @@
 int size )%7B%0A
+        this( maxToKeep , size , null );%0A    %7D%0A%0A    public ByteBufferPool( int maxToKeep , int size , ByteOrder order )%7B%0A
         supe
@@ -368,22 +368,50 @@
 = size;%0A
+        _order = order;%0A
     %7D%0A
+    
 %0A    pub
@@ -446,22 +446,31 @@
         
-return
+ByteBuffer bb =
  ByteBuf
@@ -494,30 +494,115 @@
 t( _size );%0A
+        if ( _order != null )%0A            bb.order( _order );%0A        return bb;%0A
     %7D%0A
+    
 %0A    public 
@@ -748,10 +748,38 @@
  _size;%0A
+    final ByteOrder _order;%0A
 %7D%0A

order option