Home Tutorial Java Corejava Nio Wraps a double type array into a buffer

 
 

Share on Google+Share on Google+
Wraps a double type array into a buffer
Posted on: July 28, 2010 at 12:00 AM
Advertisement
In this tutorial you will see how to wraps a double array into a buffer.

Wraps a double type array into a buffer

In this tutorial you will see how to wraps a double array into a buffer. The public static DoubleBuffer wrap(double[] array) method allow double array to wrap it into a buffer.

Code:

import java.nio.DoubleBuffer;

public class DoubleBufferDemo {
  public static void main(String[] args) {
    double[] ch = new double[] { 121.3232323.24332353.4432.45453.756 };
    DoubleBuffer doublebuffer = DoubleBuffer.wrap(ch);
    System.out.println(doublebuffer.get(1));
  }
}

Output:

  2323.243

Download this code

Advertisement

Related Tags for Wraps a double type array into a buffer:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 28, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com