Method AsReadOnlyBuffer
AsReadOnlyBuffer()
Returns a read-only buffer that shares its content with this buffer.
The returned buffer is guaranteed to be a new instance, even if this buffer is read-only itself. The new buffer's position, limit, capacity and mark are the same as this buffer.
The new buffer shares its content with this buffer, which means this buffer's change of content will be visible to the new buffer. The two buffer's position, limit and mark are independent.
Declaration
public abstract ByteBuffer AsReadOnlyBuffer()
Returns
Type | Description |
---|---|
ByteBuffer | a read-only version of this buffer. |