Top Fields Constructors Methods
org.wildfly.common.iteration

pack-priv final Class LimitedByteIterator

extends ByteIterator
Class Inheritance
Imports
java.util.NoSuchElementException

Field Summary

Modifier and TypeField and Description
private final ByteIterator
pack-priv long
private final long
Inherited from org.wildfly.common.iteration.ByteIterator:
EMPTY

Constructor Summary

AccessConstructor and Description
pack-priv
LimitedByteIterator(final ByteIterator iter, final long size)

Method Summary

Modifier and TypeMethod and Description
public int
drain(final byte[]
the buffer into which the data is drained
dst
,
final int
the start offset in array dst at which the data is written.
offs
,
final int
the maximum number of bytes to drain
len
)

Overrides org.wildfly.common.iteration.ByteIterator.drain.

Drains up to len bytes from this iterator into the given dst array.
public long
public boolean
hasNext()

Implements abstract org.wildfly.common.iteration.ByteIterator.hasNext.

Implements org.wildfly.common.iteration.BiDirIntIterator.hasNext.

Determine if there are more bytes after the current byte.
public boolean
hasPrevious()

Implements abstract org.wildfly.common.iteration.ByteIterator.hasPrevious.

Implements org.wildfly.common.iteration.BiDirIntIterator.hasPrevious.

Determine if there are more bytes before the current byte.
public int
public int
peekNext()

Implements abstract org.wildfly.common.iteration.ByteIterator.peekNext.

Implements org.wildfly.common.iteration.BiDirIntIterator.peekNext.

Peek at the next byte without advancing.
public int
peekPrevious()

Implements abstract org.wildfly.common.iteration.ByteIterator.peekPrevious.

Implements org.wildfly.common.iteration.BiDirIntIterator.peekPrevious.

Peek at the previous byte without moving backwards.
public int
Inherited from org.wildfly.common.iteration.ByteIterator:
appendToasInputStreamasLatin1StringasUtf8Stringbase32Encodebase32Encodebase32Encodebase64Encodebase64Encodebase64EncodecontentEqualsdelimitedBydoFinaldoFinaldraindraindraindrainAlldrainTodrainToLatin1drainToUtf8getBE16getBE32getBE64getLE16getLE32getLE64getPackedBE32getPackedBE64hexEncodehexEncodeinterleavedWithinterleavedWithlimitedToofByteBufferofBytesofBytesofBytesofBytesofIteratorssignupdateupdateupdateverify

Field Detail

iterback to summary
private final ByteIterator iter
offsetback to summary
pack-priv long offset
sizeback to summary
private final long size

Constructor Detail

LimitedByteIteratorback to summary
pack-priv LimitedByteIterator(final ByteIterator iter, final long size)

Method Detail

drainback to summary
public int drain(final byte[] dst, final int offs, final int len)

Overrides org.wildfly.common.iteration.ByteIterator.drain.

Doc from org.wildfly.common.iteration.ByteIterator.drain.

Drains up to len bytes from this iterator into the given dst array. An attempt is made to drain as many as len bytes, but a smaller number may be drained.

The number of bytes actually drained is returned as an integer. Unlike InputStream#read(byte[], int, int), this method never returns a negative result.

Parameters
dst:byte[]

the buffer into which the data is drained

offs:int

the start offset in array dst at which the data is written.

len:int

the maximum number of bytes to drain

Returns:int

the total number of bytes drained into dst, always greater or equal to 0

getIndexback to summary
public long getIndex()

Implements abstract org.wildfly.common.iteration.ByteIterator.getIndex.

Implements org.wildfly.common.iteration.IndexIterator.getIndex.

Doc from org.wildfly.common.iteration.ByteIterator.getIndex.

Get the current offset, in bytes.

Returns:long

the byte offset

hasNextback to summary
public boolean hasNext()

Implements abstract org.wildfly.common.iteration.ByteIterator.hasNext.

Implements org.wildfly.common.iteration.BiDirIntIterator.hasNext.

Doc from org.wildfly.common.iteration.ByteIterator.hasNext.

Determine if there are more bytes after the current byte.

Returns:boolean

true if there are more bytes, false otherwise

hasPreviousback to summary
public boolean hasPrevious()

Implements abstract org.wildfly.common.iteration.ByteIterator.hasPrevious.

Implements org.wildfly.common.iteration.BiDirIntIterator.hasPrevious.

Doc from org.wildfly.common.iteration.ByteIterator.hasPrevious.

Determine if there are more bytes before the current byte.

Returns:boolean

true if there are more bytes, false otherwise

nextback to summary
public int next()

Implements abstract org.wildfly.common.iteration.ByteIterator.next.

Implements org.wildfly.common.iteration.BiDirIntIterator.next.

Doc from org.wildfly.common.iteration.ByteIterator.next.

Get the next byte.

Returns:int

the next byte

peekNextback to summary
public int peekNext() throws NoSuchElementException

Implements abstract org.wildfly.common.iteration.ByteIterator.peekNext.

Implements org.wildfly.common.iteration.BiDirIntIterator.peekNext.

Doc from org.wildfly.common.iteration.ByteIterator.peekNext.

Peek at the next byte without advancing.

Returns:int

the next byte

Exceptions
NoSuchElementException:
if hasNext() returns false
peekPreviousback to summary
public int peekPrevious() throws NoSuchElementException

Implements abstract org.wildfly.common.iteration.ByteIterator.peekPrevious.

Implements org.wildfly.common.iteration.BiDirIntIterator.peekPrevious.

Doc from org.wildfly.common.iteration.ByteIterator.peekPrevious.

Peek at the previous byte without moving backwards.

Returns:int

the previous byte

Exceptions
NoSuchElementException:
if hasPrevious() returns false
previousback to summary
public int previous()

Implements abstract org.wildfly.common.iteration.ByteIterator.previous.

Implements org.wildfly.common.iteration.BiDirIntIterator.previous.

Doc from org.wildfly.common.iteration.ByteIterator.previous.

Get the previous byte.

Returns:int

the previous byte