The duplicate() method of java.nio.DoubleBuffer Class is used to Create a new float buffer that shares the given buffer’s content.
The content of the new buffer will be that of this buffer. Changes to this buffer’s content will be visible in the new buffer, and vice versa; the two buffers’ position, limit, and mark values will be independent.
The new buffer’s capacity, limit, position, and mark values will be identical to those of this buffer. The new buffer will be direct if, and only if, this buffer is direct, and it will be read-only if, and only if, this buffer is read-only.
public abstract DoubleBuffer duplicate()
Return Value: This method returns the new double buffer which is carrying the previous double buffer content
Below are the examples to illustrate the duplicate() method:
Please Login to comment...