Indicate the modifications youd need to make to the code in the previous exercise if you want
Question:
Indicate the modifications you’d need to make to the code in the previous exercise if you want tempBuf2 to be a ByteBuffer instead of a Doublebuffer. Assume that tempBuf continues to be a DoubleBuffer. Keep in mind that the number of bytes needed is eight times the number of doubles. You can use ByteBuffer’s asDoubleBuffer method to put double values into and get double values out of a ByteBuffer, but these operations do not change the nature of ByteBuffer’s underlying array of bytes. So you will not be able to use ByteBuffer’s array method to transfer its contents to the original double[] array, and the final output loop will need to get its data from the ByteBuffer object instead of the original double[] array. ByteBuffer’s asDoubleBuffer method will help you do this.
Step by Step Answer:
Introduction To Programming With Java A Problem Solving Approach
ISBN: 9781260575248
3rd International Edition
Authors: John Dean