IntBuffer: hasRemaining() : IntBuffer « java.nio « Java by API






IntBuffer: hasRemaining()

 
import java.nio.ByteBuffer;
import java.nio.IntBuffer;

public class Main {
  public static void main(String[] args) {
    ByteBuffer bb = ByteBuffer.wrap(new byte[] { 0, 0, 0, 0, 0, 0, 0, 'a' });
    bb.rewind();
    IntBuffer ib = ((ByteBuffer) bb.rewind()).asIntBuffer();
    System.out.println("Int Buffer");
    while (ib.hasRemaining())
      System.out.println(ib.position() + " -> " + ib.get());

  }
}

   
  








Related examples in the same category

1.IntBuffer: get()
2.IntBuffer: position()
3.IntBuffer: put(int i)