Rajeshwari M wrote:
Hi All,
Hi,

          I've written small program to test bytebuffer acquire and release
methods.

Program:

import org.apache.mina.common.ByteBuffer;

public class ByteBufferTest {

    public static void test() {
        try{
            ByteBuffer b = ByteBuffer.allocate(4000);
            byte b1=1;
            b.put(b1);
            b.acquire();
            b.release();
            b.release(); // If I call release() method one more time. I get
IlegalStateException in next line of acquire(). If I dont call release()
second time. acquire() is not throwing any error.
            b.acquire();

        }catch(Exception e){
            e.printStackTrace();
        }

    }

    public static void main(String a[]){
        test();
    }
}

Does that means, we need to call release() two times to release the buffer
actually ???
Well, the best would be to look at the current code, and try to see if it's the case. Either you do it, or we do it, but the solution will be to look at the code anyway, and see if there is a bug or not :)


--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to