public class FixedLengthByteIterable extends ByteIterableBase
ByteIterable as a part of another (source) ByteIterable.
Is used in basic implementation of ByteIterable.subIterable(int, int).| Modifier and Type | Field and Description |
|---|---|
protected int |
offset |
protected ByteIterable |
source |
bytes, length, SINGLE_BYTESEMPTY, EMPTY_BYTES, EMPTY_ITERATOR| Modifier | Constructor and Description |
|---|---|
protected |
FixedLengthByteIterable(@NotNull ByteIterable source,
int offset,
int length) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytesUnsafe() |
protected ByteIterator |
getIterator() |
int |
getLength() |
int |
getOffset() |
ByteIterable |
getSource() |
@NotNull ByteIterable |
subIterable(int offset,
int length) |
protected final ByteIterable source
protected final int offset
protected FixedLengthByteIterable(@NotNull
@NotNull ByteIterable source,
int offset,
int length)
public byte[] getBytesUnsafe()
getBytesUnsafe in interface ByteIterablegetBytesUnsafe in class ByteIterableBaseByteIterable. May return array with length greater than ByteIterable.getLength().public int getOffset()
public int getLength()
getLength in interface ByteIterablegetLength in class ByteIterableBaseByteIterable.@NotNull public @NotNull ByteIterable subIterable(int offset, int length)
subIterable in interface ByteIterablesubIterable in class ByteIterableBaseoffset - start offset, inclusivelength - length of the sub-iterableByteIterable starting from offset.public ByteIterable getSource()
getSource in class ByteIterableBaseprotected ByteIterator getIterator()
getIterator in class ByteIterableBase