|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.io.AbstractReadBuffer
public abstract class AbstractReadBuffer
Abstract base implementation of the ReadBuffer interface.
Nested Class Summary | |
---|---|
class |
AbstractReadBuffer.AbstractBufferInput
This is an implementation of the BufferInput interface that delegates its work back to its ReadBuffer. |
Nested classes/interfaces inherited from interface com.tangosol.io.ReadBuffer |
---|
ReadBuffer.BufferInput |
Field Summary | |
---|---|
static Binary |
NO_BINARY
An empty Binary object. |
static byte[] |
NO_BYTES
An empty byte array (by definition immutable). |
Constructor Summary | |
---|---|
AbstractReadBuffer()
|
Method Summary | |
---|---|
protected void |
checkBounds(int of,
int cb)
Check if the specified read is within bounds. |
Object |
clone()
Create a clone of this ReadBuffer object. |
boolean |
equals(Object o)
Compare two ReadBuffer objects for equality. |
ReadBuffer.BufferInput |
getBufferInput()
Get a BufferInput object to read data from this buffer. |
ReadBuffer |
getReadBuffer(int of,
int cb)
Obtain a ReadBuffer for a portion of this ReadBuffer. |
protected ReadBuffer.BufferInput |
instantiateBufferInput()
Factory method: Instantiate a BufferInput object to read data from the ReadBuffer. |
protected abstract ReadBuffer |
instantiateReadBuffer(int of,
int cb)
Factory method: Instantiate a ReadBuffer for a portion of this ReadBuffer. |
Binary |
toBinary()
Returns a new Binary object that holds the complete contents of this ReadBuffer. |
Binary |
toBinary(int of,
int cb)
Returns a Binary object that holds the specified portion of this ReadBuffer. |
byte[] |
toByteArray()
Get the contents of the ReadBuffer as a byte array. |
byte[] |
toByteArray(int of,
int cb)
Get a portion of the contents of the ReadBuffer as a byte array. |
Methods inherited from interface com.tangosol.io.ReadBuffer |
---|
byteAt, copyBytes, length |
Field Detail |
---|
public static final byte[] NO_BYTES
public static final Binary NO_BINARY
Constructor Detail |
---|
public AbstractReadBuffer()
Method Detail |
---|
public ReadBuffer.BufferInput getBufferInput()
getBufferInput
in interface ReadBuffer
public ReadBuffer getReadBuffer(int of, int cb)
getReadBuffer
in interface ReadBuffer
of
- the beginning index, inclusivecb
- the number of bytes to include in the resulting ReadBuffer
public byte[] toByteArray()
This is the equivalent of toByteArray(0, length())
.
toByteArray
in interface ReadBuffer
public byte[] toByteArray(int of, int cb)
This is the equivalent of
getReadBuffer(of, cb).toByteArray()
.
toByteArray
in interface ReadBuffer
of
- the beginning index, inclusivecb
- the number of bytes to include in the resulting byte[]
public Binary toBinary()
This is the equivalent of toBinary(0, length())
.
toBinary
in interface ReadBuffer
public Binary toBinary(int of, int cb)
This is the equivalent of
getReadBuffer(of, cb).toBinary()
.
toBinary
in interface ReadBuffer
of
- the beginning index, inclusivecb
- the number of bytes to include in the Binary object
public boolean equals(Object o)
o
- a ReadBuffer object
public Object clone()
clone
in interface ReadBuffer
protected abstract ReadBuffer instantiateReadBuffer(int of, int cb)
of
- the beginning index, inclusivecb
- the number of bytes to include in the resulting ReadBuffer
protected ReadBuffer.BufferInput instantiateBufferInput()
protected void checkBounds(int of, int cb)
of
- the absolute offset of the read operationcb
- the length in bytes of the read operation
IndexOutOfBoundsException
- if the specified read is not within
bounds
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |