Share on Google+Share on Google+

Get the capacity of a buffer

In this tutorial you will learn about how get the capacity of a buffer

Get the capacity of a buffer

In this tutorial we will see how to get size of buffer using capacity() method.


import java.nio.CharBuffer;

public class CharBufferCapacityDemo {
  public static void main(String[] args) {
    CharBuffer charbuffer1 = CharBuffer.allocate(6);



Download this code


Posted on: July 24, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.