|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.io.AbstractReadBuffer
com.tangosol.io.MultiBufferReadBuffer
public final class MultiBufferReadBuffer
The MultiBufferReadBuffer is a ReadBuffer implementation that presents a view across any number of underlying ReadBuffer objects, as if they were appended end-to-end into a single ReadBuffer.
Nested Class Summary | |
---|---|
class |
MultiBufferReadBuffer.MultiBufferInput An implementation of the BufferInput interface that is backed by a series of the underlying ReadBuffer BufferInput objects. |
Nested classes/interfaces inherited from class com.tangosol.io.AbstractReadBuffer |
---|
AbstractReadBuffer.AbstractBufferInput |
Nested classes/interfaces inherited from interface com.tangosol.io.ReadBuffer |
---|
ReadBuffer.BufferInput |
Field Summary |
---|
Fields inherited from class com.tangosol.io.AbstractReadBuffer |
---|
NO_BINARY, NO_BYTES |
Constructor Summary | |
---|---|
MultiBufferReadBuffer(ReadBuffer[] abuf) Construct a MultiBufferReadBuffer from an array of underlying ReadBuffer objects. |
Method Summary | |
---|---|
byte |
byteAt(int of) Returns the byte at the specified offset. |
void |
copyBytes(int ofBegin, int ofEnd, byte[] abDest, int ofDest) Copies bytes from this ReadBuffer into the destination byte array. |
protected ReadBuffer |
getBuffer(int iBuffer) Obtain the specified buffer. |
protected int |
getBufferCount() Determine the number of ReadBuffer objects that contain the data presented by this MultiBufferReadBuffer. |
protected int |
getBufferIndexByOffset(int of) Determine which underlying ReadBuffer contains the specified offset. |
protected int |
getBufferOffset(int iBuffer) Determine the offset of the specified buffer. |
ReadBuffer.BufferInput |
getDestructiveBufferInput() Return a self-destructing BufferInput over this Buffer. |
protected ReadBuffer.BufferInput |
instantiateBufferInput() Factory method: Instantiate a BufferInput object to read data from the ReadBuffer. |
protected ReadBuffer.BufferInput |
instantiateBufferInput(boolean fDestructive) Factory method: Instantiate a BufferInput object to read data from the ReadBuffer. |
protected ReadBuffer |
instantiateReadBuffer(int of, int cb) Factory method: Instantiate a ReadBuffer for a portion of this ReadBuffer. |
int |
length() Determine the length of the buffer. |
protected ReadBuffer |
releaseBuffer(int iBuffer) Release the specified buffer. |
Binary |
toBinary(int of, int cb) Returns a Binary object that holds the specified portion of this ReadBuffer. This is the equivalent of |
byte[] |
toByteArray(int of, int cb) Get a portion of the contents of the ReadBuffer as a byte array. This is the equivalent of |
Methods inherited from class com.tangosol.io.AbstractReadBuffer |
---|
checkBounds, clone, equals, getBufferInput, getReadBuffer, toBinary, toByteArray |
Constructor Detail |
---|
public MultiBufferReadBuffer(ReadBuffer[] abuf)
abuf
- an array of ReadBuffer objects from which to construct this MultiBufferReadBufferMethod Detail |
---|
public ReadBuffer.BufferInput getDestructiveBufferInput()
public int length()
public byte byteAt(int of)
0
to length() - 1
. The first byte of the sequence is at offset 0
, the next at offset 1
, and so on, as for array indexing.of
- the offset (index) of the bytepublic void copyBytes(int ofBegin, int ofEnd, byte[] abDest, int ofDest)
The first byte to be copied is at offset ofBegin
; the last byte to be copied is at offset ofEnd-1
(thus the total number of bytes to be copied is ofEnd - ofBegin
). The bytes are copied into the subarray of abDest
starting at offset ofDest
and ending at index:
ofDest + (ofEnd - ofBegin) - 1
This method is the ReadBuffer equivalent of String.getChars(int, int, char[], int)
. It allows the caller to extract a chunk of bytes into the caller's own array.
ofBegin
- offset of the first byte in the ReadBuffer to copyofEnd
- offset after the last byte in the ReadBuffer to copyabDest
- the destination byte arrayofDest
- the offset in the destination byte array to copy the first byte topublic byte[] toByteArray(int of, int cb)
This is the equivalent of getReadBuffer(of, cb).toByteArray()
.
toByteArray
in interface ReadBuffer
toByteArray
in class AbstractReadBuffer
of
- the beginning index, inclusivecb
- the number of bytes to include in the resulting byte[]public Binary toBinary(int of, int cb)
This is the equivalent of getReadBuffer(of, cb).toBinary()
.
toBinary
in interface ReadBuffer
toBinary
in class AbstractReadBuffer
of
- the beginning index, inclusivecb
- the number of bytes to include in the Binary objectprotected ReadBuffer instantiateReadBuffer(int of, int cb)
instantiateReadBuffer
in class AbstractReadBuffer
of
- the beginning index, inclusivecb
- the number of bytes to include in the resulting ReadBufferprotected ReadBuffer.BufferInput instantiateBufferInput()
instantiateBufferInput
in class AbstractReadBuffer
protected ReadBuffer.BufferInput instantiateBufferInput(boolean fDestructive)
fDestructive
- true iff the BufferInput should self-destruct as it is advancedprotected int getBufferCount()
protected int getBufferOffset(int iBuffer)
iBuffer
- an index 0 <= iBuffer < getBufferCount()protected ReadBuffer getBuffer(int iBuffer)
iBuffer
- an index 0 <= iBuffer < getBufferCount()protected ReadBuffer releaseBuffer(int iBuffer)
iBuffer
- an index 0 <= iBuffer < getBufferCount()protected int getBufferIndexByOffset(int of)
of
- an offset into this MultiBufferReadBuffer
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |