Package org.elasticsearch.nio
Class Page
java.lang.Object
org.elasticsearch.nio.Page
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class Page
extends java.lang.Object
implements java.io.Closeable
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description java.nio.ByteBufferbyteBuffer()Returns theByteBufferfor this page.voidclose()Pageduplicate()Duplicates this page and increments the reference count.
-
Constructor Details
-
Method Details
-
duplicate
Duplicates this page and increments the reference count. The new page must be closed independently of the original page.- Returns:
- the new page
-
byteBuffer
public java.nio.ByteBuffer byteBuffer()Returns theByteBufferfor this page. Modifications to the limits, positions, etc of the buffer will also mutate this page. CallByteBuffer.duplicate()to avoid mutating the page.- Returns:
- the byte buffer
-
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-