LongBuffer: get() : LongBuffer « java.nio « Java by API






LongBuffer: get()

 

import java.nio.ByteBuffer;
import java.nio.LongBuffer;

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();
    LongBuffer lb = ((ByteBuffer) bb.rewind()).asLongBuffer();
    System.out.println("Long Buffer");
    while (lb.hasRemaining())
      System.out.println(lb.position() + " -> " + lb.get());
  }
}

   
  








Related examples in the same category

1.LongBuffer: clear()
2.LongBuffer: get(long[] dst)
3.ShortBuffer: hasRemaining()
4.LongBuffer: position()
5.LongBuffer: put(long l)
6.LongBuffer: put(long[] src, int offset, int length)
7.LongBuffer: remaining()