public class ByteBufferByteIterable extends java.lang.Object implements ByteIterable
ByteBuffer to ByteIterable. Doesn't support getBytesUnsafe() as
it unconditionally throws UnsupportedOperationException.EMPTY, EMPTY_BYTES, EMPTY_ITERATOR| Constructor and Description |
|---|
ByteBufferByteIterable(@NotNull java.nio.ByteBuffer buffer) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(@NotNull ByteIterable right) |
byte[] |
getBytesUnsafe() |
int |
getLength() |
ByteIterator |
iterator() |
@NotNull ByteIterable |
subIterable(int offset,
int length) |
public ByteBufferByteIterable(@NotNull
@NotNull java.nio.ByteBuffer buffer)
public ByteIterator iterator()
iterator in interface ByteIterablepublic byte[] getBytesUnsafe()
getBytesUnsafe in interface ByteIterableUnsupportedOperationException.java.lang.UnsupportedOperationException - always since this operation is unsupportedpublic int getLength()
getLength in interface ByteIterableByteIterable.@NotNull public @NotNull ByteIterable subIterable(int offset, int length)
subIterable in interface ByteIterableoffset - start offset, inclusivelength - length of the sub-iterableByteIterable starting from offset.public int compareTo(@NotNull
@NotNull ByteIterable right)
compareTo in interface java.lang.Comparable<ByteIterable>