| Modifier and Type | Class and Description |
|---|---|
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private final Object | |
| private final Cleaner | |
| pack-priv static final boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | |
| pack-priv | DirectByteBuffer(long addr, int cap, Object ob, FileDescriptor fd, boolean isSync, MemorySegment segment)
|
| pack-priv | |
| protected | DirectByteBuffer(int cap, long addr, FileDescriptor fd, Runnable unmapper, boolean isSync, MemorySegment segment)
|
| pack-priv | DirectByteBuffer(DirectBuffer db, int mark, int pos, int lim, int cap, int off, FileDescriptor fd, boolean isSync, MemorySegment segment)
|
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public CharBuffer | asCharBuffer()
Implements abstract java. Creates a view of this byte buffer as a char buffer. |
| public DoubleBuffer | asDoubleBuffer()
Implements abstract java. Creates a view of this byte buffer as a double buffer. |
| public FloatBuffer | asFloatBuffer()
Implements abstract java. Creates a view of this byte buffer as a float buffer. |
| public IntBuffer | asIntBuffer()
Implements abstract java. Creates a view of this byte buffer as an int buffer. |
| public LongBuffer | asLongBuffer()
Implements abstract java. Creates a view of this byte buffer as a long buffer. |
| public ByteBuffer | asReadOnlyBuffer()
Implements abstract java. Creates a new, read-only byte buffer that shares this buffer's content. |
| public ShortBuffer | asShortBuffer()
Implements abstract java. Creates a view of this byte buffer as a short buffer. |
| public Object | |
| pack-priv Object | |
| private static int | |
| public Cleaner | |
| public MappedByteBuffer | compact()
Implements abstract java. Compacts this buffer (optional operation). |
| public MappedByteBuffer | duplicate()
Implements abstract java. Creates a new byte buffer that shares this buffer's content. |
| public byte | |
| public byte | |
| private char | |
| public char | getChar()
Implements abstract java. Relative get method for reading a char value. |
| public char | getChar(int i)
Implements abstract java. Absolute get method for reading a char value. |
| private double | |
| public double | getDouble()
Implements abstract java. Relative get method for reading a double value. |
| public double | getDouble(int i)
Implements abstract java. Absolute get method for reading a double value. |
| private float | |
| public float | getFloat()
Implements abstract java. Relative get method for reading a float value. |
| public float | getFloat(int i)
Implements abstract java. Absolute get method for reading a float value. |
| private int | |
| public int | getInt()
Implements abstract java. Relative get method for reading an int value. |
| public int | getInt(int i)
Implements abstract java. Absolute get method for reading an int value. |
| private long | |
| public long | getLong()
Implements abstract java. Relative get method for reading a long value. |
| public long | getLong(int i)
Implements abstract java. Absolute get method for reading a long value. |
| private short | |
| public short | getShort()
Implements abstract java. Relative get method for reading a short value. |
| public short | getShort(int i)
Implements abstract java. Absolute get method for reading a short value. |
| pack-priv AbstractMemorySegmentImpl | heapSegment(Object base, long offset, long length, boolean readOnly, MemorySessionImpl bufferScope)
Implements abstract java.
|
| public boolean | isDirect()
Implements abstract java. Tells whether or not this byte buffer is direct. |
| public boolean | isReadOnly()
Implements abstract java. Tells whether or not this buffer is read-only. |
| private long | |
| public ByteBuffer | |
| public ByteBuffer | put(int i, byte x)
Implements abstract java. Absolute put method (optional operation). |
| private ByteBuffer | |
| public ByteBuffer | putChar(char x)
Implements abstract java. Relative put method for writing a char value (optional operation). |
| public ByteBuffer | putChar(int i, char x)
Implements abstract java. Absolute put method for writing a char value (optional operation). |
| private ByteBuffer | |
| public ByteBuffer | putDouble(double x)
Implements abstract java. Relative put method for writing a double value (optional operation). |
| public ByteBuffer | putDouble(int i, double x)
Implements abstract java. Absolute put method for writing a double value (optional operation). |
| private ByteBuffer | |
| public ByteBuffer | putFloat(float x)
Implements abstract java. Relative put method for writing a float value (optional operation). |
| public ByteBuffer | putFloat(int i, float x)
Implements abstract java. Absolute put method for writing a float value (optional operation). |
| private ByteBuffer | |
| public ByteBuffer | putInt(int x)
Implements abstract java. Relative put method for writing an int value (optional operation). |
| public ByteBuffer | putInt(int i, int x)
Implements abstract java. Absolute put method for writing an int value (optional operation). |
| private ByteBuffer | |
| public ByteBuffer | putLong(long x)
Implements abstract java. Relative put method for writing a long value (optional operation). |
| public ByteBuffer | putLong(int i, long x)
Implements abstract java. Absolute put method for writing a long value (optional operation). |
| private ByteBuffer | |
| public ByteBuffer | putShort(short x)
Implements abstract java. Relative put method for writing a short value (optional operation). |
| public ByteBuffer | putShort(int i, short x)
Implements abstract java. Absolute put method for writing a short value (optional operation). |
| pack-priv int | scaleShifts()
Implements abstract java. Returns the scale shifts for this Buffer. |
| public MappedByteBuffer | slice()
Implements abstract java. Creates a new byte buffer whose content is a shared subsequence of this buffer's content. |
| public MappedByteBuffer | slice(int index, int length)
Implements abstract java. Creates a new byte buffer whose content is a shared subsequence of this buffer's content. |
| att | back to summary |
|---|---|
| private final Object att | |
| cleaner | back to summary |
|---|---|
| private final Cleaner cleaner | |
| UNALIGNED | back to summary |
|---|---|
| pack-priv static final boolean UNALIGNED | |
| DirectByteBuffer | back to summary |
|---|---|
| pack-priv DirectByteBuffer(int cap) | |
| DirectByteBuffer | back to summary |
|---|---|
| pack-priv DirectByteBuffer(long addr, int cap, Object ob, MemorySegment segment) | |
| DirectByteBuffer | back to summary |
|---|---|
| pack-priv DirectByteBuffer(long addr, int cap, Object ob, FileDescriptor fd, boolean isSync, MemorySegment segment) | |
| DirectByteBuffer | back to summary |
|---|---|
| pack-priv DirectByteBuffer(long addr, long cap) | |
| DirectByteBuffer | back to summary |
|---|---|
| protected DirectByteBuffer(int cap, long addr, FileDescriptor fd, Runnable unmapper, boolean isSync, MemorySegment segment) | |
| DirectByteBuffer | back to summary |
|---|---|
| pack-priv DirectByteBuffer(DirectBuffer db, int mark, int pos, int lim, int cap, int off, FileDescriptor fd, boolean isSync, MemorySegment segment) | |
| address | back to summary |
|---|---|
| public long address() Implements sun. | |
| asCharBuffer | back to summary |
|---|---|
| public CharBuffer asCharBuffer() Implements abstract java. Doc from java. Creates a view of this byte buffer as a char buffer. The content of the new buffer will start at this buffer's current position. 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 position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by two, its mark will be undefined, and its byte order will be that of the byte buffer at the moment the view is created. 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. | |
| asDoubleBuffer | back to summary |
|---|---|
| public DoubleBuffer asDoubleBuffer() Implements abstract java. Doc from java. Creates a view of this byte buffer as a double buffer. The content of the new buffer will start at this buffer's current position. 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 position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by eight, its mark will be undefined, and its byte order will be that of the byte buffer at the moment the view is created. 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. | |
| asFloatBuffer | back to summary |
|---|---|
| public FloatBuffer asFloatBuffer() Implements abstract java. Doc from java. Creates a view of this byte buffer as a float buffer. The content of the new buffer will start at this buffer's current position. 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 position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by four, its mark will be undefined, and its byte order will be that of the byte buffer at the moment the view is created. 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. | |
| asIntBuffer | back to summary |
|---|---|
| public IntBuffer asIntBuffer() Implements abstract java. Doc from java. Creates a view of this byte buffer as an int buffer. The content of the new buffer will start at this buffer's current position. 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 position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by four, its mark will be undefined, and its byte order will be that of the byte buffer at the moment the view is created. 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. | |
| asLongBuffer | back to summary |
|---|---|
| public LongBuffer asLongBuffer() Implements abstract java. Doc from java. Creates a view of this byte buffer as a long buffer. The content of the new buffer will start at this buffer's current position. 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 position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by eight, its mark will be undefined, and its byte order will be that of the byte buffer at the moment the view is created. 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. | |
| asReadOnlyBuffer | back to summary |
|---|---|
| public ByteBuffer asReadOnlyBuffer() Implements abstract java. Doc from java. Creates a new, read-only byte buffer that shares this 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; the new buffer itself, however, will be read-only and will not allow the shared content to be modified. 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, and its byte
order will be If this buffer is itself read-only then this method behaves in
exactly the same way as the | |
| asShortBuffer | back to summary |
|---|---|
| public ShortBuffer asShortBuffer() Implements abstract java. Doc from java. Creates a view of this byte buffer as a short buffer. The content of the new buffer will start at this buffer's current position. 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 position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by two, its mark will be undefined, and its byte order will be that of the byte buffer at the moment the view is created. 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. | |
| attachment | back to summary |
|---|---|
| public Object attachment() Implements sun. | |
| base | back to summary |
|---|---|
| pack-priv Object base() Overrides java.
| |
| checkCapacity | back to summary |
|---|---|
| private static int checkCapacity(long capacity) | |
| cleaner | back to summary |
|---|---|
| public Cleaner cleaner() Implements sun. | |
| compact | back to summary |
|---|---|
| public MappedByteBuffer compact() Implements abstract java. Doc from java. Compacts this buffer (optional operation). The bytes between the buffer's current position and its limit,
if any, are copied to the beginning of the buffer. That is, the
byte at index p = The buffer's position is set to the number of bytes copied, rather than to zero, so that an invocation of this method can be followed immediately by an invocation of another relative put method. Invoke this method after writing data from a buffer in case the
write was incomplete. The following loop, for example, copies bytes
from one channel to another via the buffer buf.clear(); // Prepare buffer for use while (in.read(buf) >= 0 || buf.position != 0) { buf.flip(); out.write(buf); buf.compact(); // In case of partial write } | |
| duplicate | back to summary |
|---|---|
| public MappedByteBuffer duplicate() Implements abstract java. Doc from java. Creates a new byte buffer that shares this 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, and its byte
order will be | |
| get | back to summary |
|---|---|
| public byte get() Implements abstract java. Doc from java. Relative get method. Reads the byte at this buffer's current position, and then increments the position. | |
| get | back to summary |
|---|---|
| public byte get(int i) Implements abstract java. Doc from java. Absolute get method. Reads the byte at the given index. | |
| getChar | back to summary |
|---|---|
| private char getChar(long a) | |
| getChar | back to summary |
|---|---|
| public char getChar() Implements abstract java. Doc from java. Relative get method for reading a char value. Reads the next two bytes at this buffer's current position, composing them into a char value according to the current byte order, and then increments the position by two. | |
| getChar | back to summary |
|---|---|
| public char getChar(int i) Implements abstract java. Doc from java. Absolute get method for reading a char value. Reads two bytes at the given index, composing them into a char value according to the current byte order. | |
| getDouble | back to summary |
|---|---|
| private double getDouble(long a) | |
| getDouble | back to summary |
|---|---|
| public double getDouble() Implements abstract java. Doc from java. Relative get method for reading a double value. Reads the next eight bytes at this buffer's current position, composing them into a double value according to the current byte order, and then increments the position by eight. | |
| getDouble | back to summary |
|---|---|
| public double getDouble(int i) Implements abstract java. Doc from java. Absolute get method for reading a double value. Reads eight bytes at the given index, composing them into a double value according to the current byte order. | |
| getFloat | back to summary |
|---|---|
| private float getFloat(long a) | |
| getFloat | back to summary |
|---|---|
| public float getFloat() Implements abstract java. Doc from java. Relative get method for reading a float value. Reads the next four bytes at this buffer's current position, composing them into a float value according to the current byte order, and then increments the position by four. | |
| getFloat | back to summary |
|---|---|
| public float getFloat(int i) Implements abstract java. Doc from java. Absolute get method for reading a float value. Reads four bytes at the given index, composing them into a float value according to the current byte order. | |
| getInt | back to summary |
|---|---|
| private int getInt(long a) | |
| getInt | back to summary |
|---|---|
| public int getInt() Implements abstract java. Doc from java. Relative get method for reading an int value. Reads the next four bytes at this buffer's current position, composing them into an int value according to the current byte order, and then increments the position by four. | |
| getInt | back to summary |
|---|---|
| public int getInt(int i) Implements abstract java. Doc from java. Absolute get method for reading an int value. Reads four bytes at the given index, composing them into a int value according to the current byte order. | |
| getLong | back to summary |
|---|---|
| private long getLong(long a) | |
| getLong | back to summary |
|---|---|
| public long getLong() Implements abstract java. Doc from java. Relative get method for reading a long value. Reads the next eight bytes at this buffer's current position, composing them into a long value according to the current byte order, and then increments the position by eight. | |
| getLong | back to summary |
|---|---|
| public long getLong(int i) Implements abstract java. Doc from java. Absolute get method for reading a long value. Reads eight bytes at the given index, composing them into a long value according to the current byte order. | |
| getShort | back to summary |
|---|---|
| private short getShort(long a) | |
| getShort | back to summary |
|---|---|
| public short getShort() Implements abstract java. Doc from java. Relative get method for reading a short value. Reads the next two bytes at this buffer's current position, composing them into a short value according to the current byte order, and then increments the position by two. | |
| getShort | back to summary |
|---|---|
| public short getShort(int i) Implements abstract java. Doc from java. Absolute get method for reading a short value. Reads two bytes at the given index, composing them into a short value according to the current byte order. | |
| heapSegment | back to summary |
|---|---|
| pack-priv AbstractMemorySegmentImpl heapSegment(Object base, long offset, long length, boolean readOnly, MemorySessionImpl bufferScope) Implements abstract java.
| |
| isDirect | back to summary |
|---|---|
| public boolean isDirect() Implements abstract java. Doc from java. Tells whether or not this byte buffer is direct. | |
| isReadOnly | back to summary |
|---|---|
| public boolean isReadOnly() Implements abstract java. Doc from java. Tells whether or not this buffer is read-only. | |
| ix | back to summary |
|---|---|
| private long ix(int i) | |
| put | back to summary |
|---|---|
| public ByteBuffer put(byte x) Implements abstract java. Doc from java. Relative put method (optional operation). Writes the given byte into this buffer at the current position, and then increments the position. | |
| put | back to summary |
|---|---|
| public ByteBuffer put(int i, byte x) Implements abstract java. Doc from java. Absolute put method (optional operation). Writes the given byte into this buffer at the given index. | |
| putChar | back to summary |
|---|---|
| private ByteBuffer putChar(long a, char x) | |
| putChar | back to summary |
|---|---|
| public ByteBuffer putChar(char x) Implements abstract java. Doc from java. Relative put method for writing a char value (optional operation). Writes two bytes containing the given char value, in the current byte order, into this buffer at the current position, and then increments the position by two. | |
| putChar | back to summary |
|---|---|
| public ByteBuffer putChar(int i, char x) Implements abstract java. Doc from java. Absolute put method for writing a char value (optional operation). Writes two bytes containing the given char value, in the current byte order, into this buffer at the given index. | |
| putDouble | back to summary |
|---|---|
| private ByteBuffer putDouble(long a, double x) | |
| putDouble | back to summary |
|---|---|
| public ByteBuffer putDouble(double x) Implements abstract java. Doc from java. Relative put method for writing a double value (optional operation). Writes eight bytes containing the given double value, in the current byte order, into this buffer at the current position, and then increments the position by eight. | |
| putDouble | back to summary |
|---|---|
| public ByteBuffer putDouble(int i, double x) Implements abstract java. Doc from java. Absolute put method for writing a double value (optional operation). Writes eight bytes containing the given double value, in the current byte order, into this buffer at the given index. | |
| putFloat | back to summary |
|---|---|
| private ByteBuffer putFloat(long a, float x) | |
| putFloat | back to summary |
|---|---|
| public ByteBuffer putFloat(float x) Implements abstract java. Doc from java. Relative put method for writing a float value (optional operation). Writes four bytes containing the given float value, in the current byte order, into this buffer at the current position, and then increments the position by four. | |
| putFloat | back to summary |
|---|---|
| public ByteBuffer putFloat(int i, float x) Implements abstract java. Doc from java. Absolute put method for writing a float value (optional operation). Writes four bytes containing the given float value, in the current byte order, into this buffer at the given index. | |
| putInt | back to summary |
|---|---|
| private ByteBuffer putInt(long a, int x) | |
| putInt | back to summary |
|---|---|
| public ByteBuffer putInt(int x) Implements abstract java. Doc from java. Relative put method for writing an int value (optional operation). Writes four bytes containing the given int value, in the current byte order, into this buffer at the current position, and then increments the position by four. | |
| putInt | back to summary |
|---|---|
| public ByteBuffer putInt(int i, int x) Implements abstract java. Doc from java. Absolute put method for writing an int value (optional operation). Writes four bytes containing the given int value, in the current byte order, into this buffer at the given index. | |
| putLong | back to summary |
|---|---|
| private ByteBuffer putLong(long a, long x) | |
| putLong | back to summary |
|---|---|
| public ByteBuffer putLong(long x) Implements abstract java. Doc from java. Relative put method for writing a long value (optional operation). Writes eight bytes containing the given long value, in the current byte order, into this buffer at the current position, and then increments the position by eight. | |
| putLong | back to summary |
|---|---|
| public ByteBuffer putLong(int i, long x) Implements abstract java. Doc from java. Absolute put method for writing a long value (optional operation). Writes eight bytes containing the given long value, in the current byte order, into this buffer at the given index. | |
| putShort | back to summary |
|---|---|
| private ByteBuffer putShort(long a, short x) | |
| putShort | back to summary |
|---|---|
| public ByteBuffer putShort(short x) Implements abstract java. Doc from java. Relative put method for writing a short value (optional operation). Writes two bytes containing the given short value, in the current byte order, into this buffer at the current position, and then increments the position by two. | |
| putShort | back to summary |
|---|---|
| public ByteBuffer putShort(int i, short x) Implements abstract java. Doc from java. Absolute put method for writing a short value (optional operation). Writes two bytes containing the given short value, in the current byte order, into this buffer at the given index. | |
| scaleShifts | back to summary |
|---|---|
| pack-priv int scaleShifts() Implements abstract java. Doc from java. Returns the scale shifts for this Buffer. The scale shifts are: ByteBuffer: 0 ShortBuffer, CharBuffer: 1 IntBuffer, FloatBuffer: 2 LongBuffer, DoubleBuffer: 3
| |
| slice | back to summary |
|---|---|
| public MappedByteBuffer slice() Implements abstract java. Doc from java. Creates a new byte buffer whose content is a shared subsequence of this buffer's content. The content of the new buffer will start at this buffer's current position. 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 position will be zero, its capacity and its limit
will be the number of bytes remaining in this buffer, its mark will be
undefined, and its byte order will be
Reading bytes into physical memory by invoking | |
| slice | back to summary |
|---|---|
| public MappedByteBuffer slice(int index, int length) Implements abstract java. Doc from java. Creates a new byte buffer whose content is a shared subsequence of this buffer's content. The content of the new buffer will start at position The new buffer's position will be zero, its capacity and its limit
will be Reading bytes into physical memory by invoking
| |
| Modifier and Type | Field and Description |
|---|---|
| private final long | |
| private final int | capacity
Record Component accessed by capacity(). |
| private final long |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public int | |
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public void | |
| public long | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| address | back to summary |
|---|---|
| private final long address Record Component accessed by address(). | |
| capacity | back to summary |
|---|---|
| private final int capacity Record Component accessed by capacity(). | |
| size | back to summary |
|---|---|
| private final long size Record Component accessed by size(). | |
| Deallocator | back to summary |
|---|---|
| private Deallocator(long address, long size, int capacity) | |
| address | back to summary |
|---|---|
| public long address() Record Component getter of address. | |
| capacity | back to summary |
|---|---|
| public int capacity() Record Component getter of capacity. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation. | |
| size | back to summary |
|---|---|
| public long size() Record Component getter of size. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |