AsIntBuffer.java

import java.nio.*;
class AsIntBuffer {
  public static void main(String[] args) {
    ByteBuffer bb = ByteBuffer.allocate(5);
    System.out.println(bb.capacity());            // Affiche 5
    IntBuffer ib = bb.asIntBuffer();
    System.out.println(ib.capacity());            // Affiche 1
  }
}