Is there any limitation on the inital capacity of
"org.apache.mina.common.ByteBuffer"

The following line of code fails with the below-mentioned exceptoin:


int capacity = 2147480000; 
org.apache.mina.common.ByteBuffer byteBuffer = 
org.apache.mina.common.ByteBuffer.allocate(capacity);   

Exception in thread "main" java.lang.IllegalArgumentException: Buffer size
is too big: 2147480000
        at
org.apache.mina.common.PooledByteBufferAllocator.getBufferStackIndex(
PooledByteBufferAllocator.java:227)
        at
org.apache.mina.common.PooledByteBufferAllocator.allocate0(PooledByte
BufferAllocator.java:173)
        at
org.apache.mina.common.PooledByteBufferAllocator.allocate(PooledByteB
ufferAllocator.java:159)
        at org.apache.mina.common.ByteBuffer.allocate(ByteBuffer.java:235)
        at org.apache.mina.common.ByteBuffer.allocate(ByteBuffer.java:215)
        at
org.apache.mina.example.sumup.TestByteBuffer.main(TestByteBuffer.java
:25)

while the same request using NIO ByteBuffer succeeds:
                
"java.nio.ByteBuffer byteBuffer =  java.nio.ByteBuffer.allocate(capacity);"

This test was done on a Windows Enterprise 2003 64-bit, MINA Version 1.0.1,
JDK 5.0

Thx.
-- 
View this message in context: 
http://www.nabble.com/ByteBuffer-Initial-capacity-limitation-tf3061116.html#a8512079
Sent from the mina dev mailing list archive at Nabble.com.

Reply via email to