Java IO Tutorial - Java DoubleBuffer.hasArray()








Syntax

DoubleBuffer.hasArray() has the following syntax.

public final boolean hasArray()

Example

In the following code shows how to use DoubleBuffer.hasArray() method.

/*from ww  w  .j ava  2  s .c  o  m*/
import java.nio.DoubleBuffer;

public class Main {
  private static final int BSIZE = 1024;

  public static void main(String[] args) {
    DoubleBuffer bb = DoubleBuffer.allocate(BSIZE);

    bb.put(98765);
    System.out.println(bb.hasArray());

  }
}

The code above generates the following result.