public class LookaheadByteArrayBufferBuffer extends AbstractByteArrayBufferBuffer
byte-Buffer that represents the concatenation of multiple
ByteArrayBufferImpls. The resulting
LookaheadByteArrayBufferBufferhas its own state and does NOT modify a contained
|Modifier and Type||Field and Description|
The master buffer adapted by this buffer.
|Constructor and Description|
|Modifier and Type||Method and Description|
This method fills this buffer using the given
This method determines if there is a
This method gets the current byte in the iteration.
This method processes the number of bytes given by
This method skips the number of bytes given by
fill, getByteArray, getByteArrayCount, getBytesAvailable, getCurrentBuffer, getCurrentBufferIndex, nextBuffer, peek, sync
private final AbstractByteArrayBufferBuffer master
public LookaheadByteArrayBufferBuffer(AbstractByteArrayBufferBuffer master)
master- is the master-buffer to copy for lookahead reads.
public byte next() throws NoSuchElementException
ByteIteratorpoints to the next byte in the iteration or to the end if there is no such byte
public boolean hasNext()
public long skip(long byteCount)
byteCount- is the expected number of bytes to skip.
byteCount. However the value may be less if the end of this iterator has been reached before the according number of bytes have been skipped. The value will always be greater or equal to
public long process(ByteProcessor processor, long byteCount)
length(as far as available) using the given
processor- is the
ByteProcessorcalled to process the bytes. It may be called multiple types if the data is sliced into multiple byte-arrays.
byteCount- is the desired number of bytes to process. The value has to be greater or equal to
0. A value of
0will have no effect. If you want to process all available data to the end of stream or buffer you may use
lengththis will typically be equal to
length. However if the end of the data has been reached, a smaller value is returned. The value will always be greater or equal to
protected boolean fill(InputStream inputStream) throws IOException
inputStream. If the buffer is already filled, this method will have no effect and return
inputStream- is the
InputStreamproviding the data to fill this buffer with.
trueif the end of the stream was encountered while (re)filling this buffer,
IOException- if caused by the
Copyright © 2001–2014 mmm-Team. All rights reserved.