Creates a new byte buffer that shares this bit 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 comparable to those of this buffer in their respective units (bits vs. bytes.) 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. @return a byte buffer that is wrapped around this buffers data Converts this Buffer
to a {@link ByteBuffer}. If this Buffer
is not composite - then returned {@link ByteBuffer}'s content is a shared subsequence of this buffer's content, with {@link CompositeBuffer} this is not guaranteed.The position of the returned {@link ByteBuffer} is not guaranteed to be 0,the capacity of the returned {@link ByteBuffer} is not guaranteed to beequal to the capacity of this Buffer
. It is guaranteed that the result of the returned ByteBuffer's {@link ByteBuffer#remaining()} call will be equal to this Buffer's{@link #remaining()} call.The Buffer's and ByteBuffer's position, limit, and mark values are not guaranteed to be independent, so it's recommended to save and restore position, limit values if it is planned to change them or {@link ByteBuffer#slice()} the returned {@link ByteBuffer}.
Buffer
as a {@link ByteBuffer}.
|
|