/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.nio.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
int sizeOfDouble = 8;
int numberOfDoubles = 4;
ByteBuffer testBuf = ByteBuffer.allocateDirect(sizeOfDouble*numberOfDoubles);
testBuf.putDouble(0*sizeOfDouble, 1.0);
testBuf.putDouble(1*sizeOfDouble, 2.0);
testBuf.putDouble(2*sizeOfDouble, 3.0);
testBuf.putDouble(3*sizeOfDouble, 4.0);
for (int i = 0; i < numberOfDoubles; ++i) {
System.
out.
println("testBuf[" + i
+ "]: " + testBuf.
getDouble(sizeOfDouble
*i
)); }
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLm5pby4qOwoKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCmludCBzaXplT2ZEb3VibGUgPSA4OwppbnQgbnVtYmVyT2ZEb3VibGVzID0gNDsKQnl0ZUJ1ZmZlciB0ZXN0QnVmID0gQnl0ZUJ1ZmZlci5hbGxvY2F0ZURpcmVjdChzaXplT2ZEb3VibGUqbnVtYmVyT2ZEb3VibGVzKTsKCnRlc3RCdWYucHV0RG91YmxlKDAqc2l6ZU9mRG91YmxlLCAxLjApOwp0ZXN0QnVmLnB1dERvdWJsZSgxKnNpemVPZkRvdWJsZSwgMi4wKTsKdGVzdEJ1Zi5wdXREb3VibGUoMipzaXplT2ZEb3VibGUsIDMuMCk7CnRlc3RCdWYucHV0RG91YmxlKDMqc2l6ZU9mRG91YmxlLCA0LjApOwoKZm9yIChpbnQgaSA9IDA7IGkgPCBudW1iZXJPZkRvdWJsZXM7ICsraSkgewogICAgU3lzdGVtLm91dC5wcmludGxuKCJ0ZXN0QnVmWyIgKyBpICsgIl06ICIgKyB0ZXN0QnVmLmdldERvdWJsZShzaXplT2ZEb3VibGUqaSkpOwp9CgoJfQp9