Java I/O How to - Use the relative get()








Question

We would like to know how to use the relative get().

Answer

  //from  www .j a  v  a 2  s  .c o  m

import java.nio.ByteBuffer;

public class Main {
  public static void main(String[] argv) throws Exception {
    ByteBuffer buf = ByteBuffer.allocateDirect(10);
    byte b = buf.get();
  }
}